discourse/lib/guardian
Linca 741e9d70ad
FIX: Don't show move topic for private messages for TL4 (#28871)
In TopicController, in addition to ensure_can_move_posts!, we also
checked if the topic is private message in this line:

```ruby
raise Discourse::InvalidAccess if params[:archetype] == "private_message" && !guardian.is_staff?
```

However, this was not present in `guardian.can_move_posts?`. As a result,
the frontend topic view got an incorrect serialized result, thinking
that TL4 could move the private message post. In fact, once they tried
to move it, they got the `InvalidAccess` error message.

This commit fixes that TL4 will no longer sees the "move to" option in
the "select post" panel for a private message.
2024-09-16 11:30:05 +08:00
..
bookmark_guardian.rb FEATURE: Promote polymorphic bookmarks to default and migrate (#16729) 2022-05-23 10:07:15 +10:00
category_guardian.rb Revert "FIX: Allow category moderators to move topics to their categories" (#23810) 2023-10-06 09:00:22 +08:00
ensure_magic.rb DEV: Prefer \A and \z over ^ and $ in regexes (#19936) 2023-01-20 12:52:49 -06:00
flag_guardian.rb FIX: limit the number of custom flags to 50 (#28221) 2024-08-06 10:50:12 +10:00
group_guardian.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
post_guardian.rb FIX: serialize Flags instead of PostActionType (#28362) 2024-08-14 12:13:46 +10:00
post_revision_guardian.rb FEATURE: Allow admins to permanently delete revisions (#19913) 2023-01-19 15:09:01 -06:00
sidebar_guardian.rb DEV: specs to ensure that only admin can edit Community section (#21666) 2023-05-23 10:54:55 +10:00
tag_guardian.rb DEV: Remove TagGuardian#can_create_tag? fallback (#25535) 2024-02-02 13:48:53 +08:00
topic_guardian.rb FIX: Don't show move topic for private messages for TL4 (#28871) 2024-09-16 11:30:05 +08:00
user_guardian.rb FEATURE: Support designating multiple groups as mods on category (#28655) 2024-09-04 04:38:46 +03:00