discourse/lib/guardian
Andrei Prigorshnev 5a2ad7e386
DEV: remove calls to guardian from GroupActionLogger (#13835)
We shouldn't be checking if a user is allowed to do an action in the logger. We should be checking it just before we perform the action. In fact, guardians in the logger can make things even worse in case of a security bug. Let's say we forgot to check user's permissions before performing some action, but we still have a call to the guardian in the logger. In this case, a user would perform the action anyway, and this action wouldn't even be logged!

I've checked all cases and I confirm that we're safe to delete this calls from the logger.

I've added two calls to guardians in admin/user_controller. We didn't have security bugs there, because regular users can't access admin/... routes at all. But it's good to have calls to guardian in these methods anyway, neighboring methods have them.
2021-07-28 15:04:04 +04:00
..
bookmark_guardian.rb FEATURE: Allow editing bookmark reminders (#9437) 2020-04-17 11:08:07 +10:00
category_guardian.rb FIX: Missing category edit icon. 2021-06-28 10:54:23 +08:00
ensure_magic.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
group_guardian.rb DEV: remove calls to guardian from GroupActionLogger (#13835) 2021-07-28 15:04:04 +04:00
post_guardian.rb FEATURE: Setting to allow moderators to change post ownership (#13708) 2021-07-13 09:40:11 -05:00
post_revision_guardian.rb DEV: enable frozen string literal on all files 2019-05-13 09:31:32 +08:00
tag_guardian.rb DEV: Correct typos and spelling mistakes (#12812) 2021-05-21 11:43:47 +10:00
topic_guardian.rb FIX: Hide a post's pending flag count from TL4 users. (#13129) 2021-05-26 12:58:00 +10:00
user_guardian.rb FIX: don't allow category and tag tracking settings on staged users (#13688) 2021-07-16 14:50:40 -04:00