Skip to content

Commit

Permalink
Merge pull request #1452 from codidact/cellio/1451-fix-global-mod-check
Browse files Browse the repository at this point in the history
fix global mod check
  • Loading branch information
Oaphi authored Nov 19, 2024
2 parents 900b0df + ff6f1fc commit 4b6626b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ def post_count_on(community_id)

def is_moderator_on(community_id)
cu = community_users.where(community_id: community_id).first
cu&.is_moderator || cu&.privilege?('mod')
# is_moderator is a DB check, not a call to is_moderator()
is_global_moderator || is_admin || cu&.is_moderator || cu&.privilege?('mod') || false
end

def has_ability_on(community_id, ability_internal_id)
Expand Down

0 comments on commit 4b6626b

Please sign in to comment.