discourse/lib/guardian/localization_guardian.rb
Natalie Tay 6ebef85b77
FIX: Allow users in content_localization_allowed_groups to delete translations (#34385)
Currently the following is erroneously shown only if the post author is
in the `content_localization_allowed_groups` setting. It should actually
be shown based on the current_user, not the post's user. This bug
prevents the privileged user from deleting translations.
2025-08-18 21:57:45 +08:00

8 lines
237 B
Ruby

# frozen_string_literal: true
module LocalizationGuardian
def can_localize_content?
return false if !SiteSetting.content_localization_enabled
@user.in_any_groups?(SiteSetting.content_localization_allowed_groups_map)
end
end