Skip to content

Commit

Permalink
Add is_moderator? method to user model
Browse files Browse the repository at this point in the history
For now we consider users with `admin` and `staff` role
as moderator for reports.
  • Loading branch information
krauselukas authored and danidoni committed Sep 22, 2023
1 parent 9898bc2 commit 3cc4bfd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/api/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,10 @@ def is_nobody?
login == NOBODY_LOGIN
end

def is_moderator?
is_admin? || is_staff?
end

def is_active?
return owner.is_active? if owner

Expand Down

0 comments on commit 3cc4bfd

Please sign in to comment.