discourse/lib/guardian/flag_guardian.rb
Krzysztof Kotlarek aa88b07640
FEATURE: the ability to change the order of flags (#27269)
Continued work on moderate flags UI.
In this PR admins are allowed to change the order of flags. The notify user flag is always on top but all other flags can be moved.
2024-06-05 13:27:06 +10:00

16 lines
272 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
def can_reorder_flag?(flag)
@user.admin? && flag.name_key != "notify_user"
end
end