discourse/lib/guardian/flag_guardian.rb
Krzysztof Kotlarek 963b9fd157
FEATURE: admin can disable flags (#27171)
UI for admins to disable system flags.
2024-05-29 14:39:58 +10:00

12 lines
184 B
Ruby

# frozen_string_literal: true
module FlagGuardian
def can_edit_flag?(flag)
@user.admin? && !flag.system? && !flag.used?
end
def can_toggle_flag?
@user.admin?
end
end