mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 15:13:41 +08:00
19 lines
319 B
Ruby
19 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
|