2024-05-22 22:19:07 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module FlagGuardian
|
|
|
|
def can_edit_flag?(flag)
|
|
|
|
@user.admin? && !flag.system? && !flag.used?
|
|
|
|
end
|
2024-05-29 00:39:58 -04:00
|
|
|
|
2024-07-02 18:45:37 -04:00
|
|
|
def can_create_flag?
|
2024-08-05 20:50:12 -04:00
|
|
|
@user.admin? && Flag.custom.count < SiteSetting.custom_flags_limit
|
2024-07-02 18:45:37 -04:00
|
|
|
end
|
|
|
|
|
2024-05-29 00:39:58 -04:00
|
|
|
def can_toggle_flag?
|
|
|
|
@user.admin?
|
|
|
|
end
|
2024-06-04 23:27:06 -04:00
|
|
|
|
|
|
|
def can_reorder_flag?(flag)
|
|
|
|
@user.admin? && flag.name_key != "notify_user"
|
|
|
|
end
|
2024-05-22 22:19:07 -04:00
|
|
|
end
|