mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 19:39:30 +08:00
DEV: move post flags into database (#27125)
This is preparation for a feature that will allow admins to define their custom flags. Current behaviour should stay untouched.
This commit is contained in:

committed by
GitHub

parent
312a930ac8
commit
cfbbfd177c
7
lib/guardian/flag_guardian.rb
Normal file
7
lib/guardian/flag_guardian.rb
Normal file
@ -0,0 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module FlagGuardian
|
||||
def can_edit_flag?(flag)
|
||||
@user.admin? && !flag.system? && !flag.used?
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user