discourse/lib/guardian
Osama Sayegh e229fa65a5
FIX: Allow admins to delete invites created by others (#34064)
Admins can view the list of invites created by other users and they can
see the delete button for invites in the list, but it currently doesn't actually
delete anything due to a bug in the `invites#destroy` controller action
where it looks up the invite record by the given id and expects it to be
created by the current user, but when an invite is being deleted by an admin,
this logic fails because the invite isn't created by the admin.

This commit fixes the issue by removing this check for current user and
adding a proper guardian check that validates the action is performed by
either the user who created the invite or an admin.

Internal topic: t/158288.
2025-08-12 05:43:01 +03:00
..
bookmark_guardian.rb FEATURE: Promote polymorphic bookmarks to default and migrate (#16729) 2022-05-23 10:07:15 +10:00
category_guardian.rb FEATURE: improve the suppression for admins when required (#29041) 2024-10-02 10:52:02 +10: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 FEATURE: allow edit custom flags (#32344) 2025-04-17 12:31:52 +08:00
group_guardian.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
invite_guardian.rb FIX: Allow admins to delete invites created by others (#34064) 2025-08-12 05:43:01 +03:00
localization_guardian.rb DEV: Remove 'experimental' prefix from settings (#33233) 2025-06-19 12:23:42 +08:00
post_guardian.rb DEV: Remove now-redundant is_staff guardian check (#33852) 2025-07-31 10:39:38 +08: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 FEATURE: Add new edit_tags_allowed_groups setting (#34000) 2025-08-01 15:19:20 +08:00
topic_guardian.rb DEV: Fix up TopicGuardian#can_delete_topic? (#33965) 2025-07-31 10:41:00 +08:00
user_guardian.rb FEATURE: Make it easier for staff to see if a profile is silenced (#33537) 2025-07-14 12:44:31 +08:00