discourse/lib/guardian/flag_guardian.rb
Krzysztof Kotlarek c3fadc7330
FEATURE: created edit and delete flags (#27484)
Allow admins to create edit and delete flags.
2024-07-03 08:45:37 +10:00

20 lines
319 B
Ruby

# frozen_string_literal: true
module FlagGuardian
def can_edit_flag?(flag)
@user.admin? && !flag.system? && !flag.used?
end
def can_create_flag?
@user.admin?
end
def can_toggle_flag?
@user.admin?
end
def can_reorder_flag?(flag)
@user.admin? && flag.name_key != "notify_user"
end
end