Arthri
(Arthri)
December 17, 2022, 3:30am
1
TL0 was able to message a group with “Who can message this group?” set to “Everyone” because of a feature implemented here
Is there any way to allow TL0 members to start messages to a specific discourse group, but not to other regular members or non staff members? I am currently not finding a way to make this work. When TL0 members write to our helpdeskteam group for help, they get an off putting and confusing error message - see below.
[18%20PM]
The TL0 user is writing to a group with “who can message this member” set to “everyone”. If I make the user TL1 the message is saved with no error.
Everyone in the group…
However, this is no longer possible because of an update around the past month(our forum version is on 2.9.0.beta14). I believe this PR caused the recession
discourse:main
← discourse:issue/can-send-pm-check-not-reliant-on-system-user
opened 05:41AM - 01 Nov 22 UTC
Since the system user is a regular user, it can have its `allow_private_messages… ` user option turned off, which with our current `can_send_private_message?(Discourse.system_user)` check inside the CurrentUserSerializer, will prevent any user from sending messages in the UI if the system user is not accepting PMs.
This commit adds a new `can_send_private_messages?` method to the Guardian, which can be used in serializers and not depend on the system user. When the user actually sends a message we still rely on the old `can_send_private_message?(target)` call to see if they are allowed to send the message to the target. The new method is just to say they can "generally" send private messages.
2 Likes
martin
(Martin Brennan)
December 20, 2022, 3:11am
3
Thanks for the report @Arthri , this is fixed here:
discourse:main
← discourse:issue/fix-messageable-everyone-regression-tl0
opened 01:14AM - 20 Dec 22 UTC
The commits https://github.com/discourse/discourse/commit/e62e93f83a77adfa80b38f… bfecf82bbee14e12fe and
https://github.com/discourse/discourse/commit/d6bd4ad7ee1d3bf43ba0a2bb1948f8f306b6177a caused a regression
to the behaviour added for
https://meta.discourse.org/t/allow-tl0-to-write-messages-to-staff-group-not-to-other-members-or-non-staff/124335,
which allowed a user to message a group with the messageable_level
set to Everyone even if they were TL0 (or otherwise did not reach
the appropriate trust level). This commit fixes the issue and adjusts
the spec to reflect the real scenario.
c.f. https://meta.discourse.org/t/tl0-cant-message-groups-with-messageable-level-everyone-recession/249205
2 Likes
This topic was automatically closed after 25 hours. New replies are no longer allowed.