discourse/app
Martin Brennan d6bd4ad7ee
FIX: Make can_send_private_messages not reliant on system user (#18812)
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.
2022-11-07 09:11:18 +10:00
..
assets FEATURE: new site setting to hide user profiles by default. (#18864) 2022-11-06 16:44:17 +05:30
controllers FEATURE: new site setting to hide user profiles by default. (#18864) 2022-11-06 16:44:17 +05:30
helpers DEV: Fix greyed text for dark mode emails (#18889) 2022-11-04 15:44:49 -05:00
jobs DEV: Quote values when constructing SQL (#18827) 2022-11-01 14:05:13 -05:00
mailers FEATURE: Custom unsubscribe options (#17090) 2022-06-21 15:49:47 -03:00
models FEATURE: new site setting to hide user profiles by default. (#18864) 2022-11-06 16:44:17 +05:30
serializers FIX: Make can_send_private_messages not reliant on system user (#18812) 2022-11-07 09:11:18 +10:00
services SECURITY: Expand and improve SSRF Protections (#18815) 2022-11-01 16:33:17 +00:00
views UX: update and consolodate published page styles (#18792) 2022-11-01 14:31:39 -04:00