mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-02 17:57:36 +08:00
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.
8 lines
237 B
Ruby
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
|