Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: allow staff and direct message enabled groups to create personal chats #26655

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pangbo13
Copy link
Contributor

As an admin, I am unable to create personal chats with other users.

image

However, according to the site settings, staff members should always have the ability to create personal chats.

image

Steps to reproduce:

  1. Set chat allowed groups to TL0 & direct message enabled groups to moderators
  2. As an admin, attempt to create a personal chat with a TL1 user.

Fix

This issue is related to PR #26010

SiteSetting.chat_enabled && object.guardian.can_chat? && object.guardian.can_direct_message?

When a user attempts to create a personal chat, we should not verify whether the target user has the ability to create personal chats. Instead, as specified in the site settings, we should verify whether the current user has the ability to create personal chats.

As long as the current user is a member of the direct message enabled groups or is a staff member, they should be able to create a personal chat.

@github-actions github-actions bot added the chat PRs which include a change to Chat plugin label Apr 17, 2024
@discoursebot
Copy link

This pull request has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/cant-create-personal-chats-as-an-admin/304220/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chat PRs which include a change to Chat plugin
2 participants