mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-13 21:33:20 +01:00
add admin?
shorthand to users
This commit is contained in:
parent
ffc0ba05e1
commit
56a1c70fae
1 changed files with 4 additions and 0 deletions
|
@ -141,6 +141,10 @@ class User < ApplicationRecord
|
|||
has_role?(:moderator) || has_role?(:administrator)
|
||||
end
|
||||
|
||||
def admin?
|
||||
has_role?(:administrator)
|
||||
end
|
||||
|
||||
# region stuff used for reporting/moderation
|
||||
def report(object, reason = nil)
|
||||
existing = Report.find_by(type: "Reports::#{object.class}", target_id: object.id, user_id: self.id, deleted: false)
|
||||
|
|
Loading…
Reference in a new issue