Skip to content

Commit

Permalink
moderators can manage users
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Nov 20, 2024
1 parent 2ac664e commit 95ae916
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/policies/user_policy.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class UserPolicy < ApplicationPolicy
def index?
all_of(
user&.is_administrator?,
user&.is_moderator?,
none_of(
SiteSettings.demo_mode_enabled?
)
Expand All @@ -12,7 +12,7 @@ def show?
all_of(
one_of(
user == record,
user&.is_administrator?
user&.is_moderator?
)
)
end
Expand All @@ -22,7 +22,7 @@ def create?
SiteSettings.multiuser_enabled?,
one_of(
SiteSettings.registration_enabled?,
user&.is_administrator?
user&.is_moderator?
),
none_of(
SiteSettings.demo_mode_enabled?
Expand All @@ -41,7 +41,7 @@ def destroy?
all_of(
one_of(
user == record,
user&.is_administrator?
user&.is_moderator?
),
SiteSettings.multiuser_enabled?,
none_of(
Expand Down

0 comments on commit 95ae916

Please sign in to comment.