Skip to content

Commit

Permalink
Helps if you define the methods first
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtOfCode- committed Jan 17, 2025
1 parent 7d776b8 commit 4e6d2d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions app/models/community_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ def flag_score
end
end

alias ability? privilege?
alias ability privilege
alias grant_ability! grant_privilege!
alias recalc_ability recalc_privilege
alias recalc_abilities recalc_privileges

def privilege?(internal_id, ignore_suspension: false, ignore_mod: false)
if internal_id != 'mod' && !ignore_mod && user.is_moderator
return true # includes: privilege? 'mod'
Expand Down Expand Up @@ -129,6 +123,12 @@ def recalc_privileges(sandbox: false)
end
end

alias ability? privilege?
alias ability privilege
alias grant_ability! grant_privilege!
alias recalc_ability recalc_privilege
alias recalc_abilities recalc_privileges

# This check makes sure that every user gets the
# 'everyone' permission upon creation. We do not want
# to create a no permissions user by accident.
Expand Down

0 comments on commit 4e6d2d3

Please sign in to comment.