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
..
2022-10-26 09:05:15 +08:00
2022-08-24 01:43:42 +02:00
2022-08-04 11:05:02 +02:00
2022-09-29 20:00:38 +02:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-10-25 15:29:09 +08:00
2022-11-02 10:47:59 +01:00
2022-11-01 16:33:17 +00:00
2022-10-07 09:16:04 +11:00
2022-10-27 06:13:21 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-09-27 14:26:06 +05:30
2022-07-28 10:27:38 +08:00
2022-11-02 10:47:59 +01:00
2022-08-04 11:05:02 +02:00
2022-10-11 09:04:51 +10:00
2022-03-01 17:50:50 +00:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-10-07 16:02:03 -06:00
2022-11-02 10:47:59 +01:00
2022-10-13 02:43:56 +05:30
2022-08-04 11:05:02 +02:00
2022-11-02 10:47:59 +01:00
2022-10-05 10:50:20 +10:00
2022-10-25 15:29:09 +08:00
2022-07-28 10:27:38 +08:00
2022-10-06 12:02:48 +05:30
2022-07-28 10:27:38 +08:00
2022-09-26 13:58:40 +10:00
2022-08-04 11:05:02 +02:00
2022-08-30 09:21:41 +10:00
2022-06-30 10:18:12 +10:00
2022-05-23 10:07:15 +10:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-09-27 22:06:40 +05:30
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-11-01 16:33:17 +00:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-03-01 17:50:50 +00:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-10-21 14:48:27 +01:00
2022-11-02 10:47:59 +01:00
2022-08-26 15:16:50 +10:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-09-30 08:28:09 +00:00
2022-08-04 11:05:02 +02:00
2022-08-08 18:07:49 +02:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-09-30 00:49:17 +03:00
2022-08-30 20:33:08 +01:00
2022-08-04 11:05:02 +02:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-11-01 16:33:17 +00:00
2022-03-01 17:50:50 +00:00
2022-08-04 11:05:02 +02:00
2022-11-01 16:33:17 +00:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-11-07 09:11:18 +10:00
2022-08-04 11:05:02 +02:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-09-26 09:14:24 +10:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-10-05 10:50:20 +10:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-08-20 11:19:19 +02:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-09-26 13:58:40 +10:00
2022-08-04 11:05:02 +02:00
2022-10-05 10:50:20 +10:00
2022-09-22 14:44:27 +02:00
2022-03-01 17:50:50 +00:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-10-19 18:54:32 +03:00
2022-07-28 10:27:38 +08:00
2022-10-12 14:07:37 +03:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-08-23 15:03:57 +10:00
2022-08-04 11:05:02 +02:00
2022-03-01 17:50:50 +00:00
2022-11-02 10:47:59 +01:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-10-05 10:50:20 +10:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-10-25 15:29:09 +08:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-10-21 19:05:34 +01:00
2022-08-04 11:05:02 +02:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-10-05 10:50:20 +10:00
2022-08-04 11:05:02 +02:00
2022-10-05 10:50:20 +10:00
2022-07-28 10:27:38 +08:00
2022-09-29 09:24:33 +10:00
2022-10-25 06:18:40 +08:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00
2022-07-28 10:27:38 +08:00
2022-10-25 15:29:09 +08:00
2022-09-29 09:24:33 +10:00
2022-07-28 10:27:38 +08:00
2022-09-29 09:24:33 +10:00
2022-09-29 09:24:33 +10:00
2022-09-29 09:24:33 +10:00
2022-08-04 10:16:54 +10:00
2022-07-28 10:27:38 +08:00
2022-07-28 10:27:38 +08:00
2022-08-04 11:05:02 +02:00