class UserPolicy
Governs access to user accounts and account management actions.
Public Instance Methods
Source
# File app/policies/user_policy.rb, line 8 def create? = user&.admin?
Who is allowed: admins.
Source
# File app/policies/user_policy.rb, line 4 def index? = user&.admin?
Who is allowed: admins.
Source
# File app/policies/user_policy.rb, line 6 def new? = user&.admin?
Who is allowed: admins.
Source
# File app/policies/user_policy.rb, line 19 def reactivate? = user&.admin? && record != user
Who is allowed: admins, but not on their own account.
Source
# File app/policies/user_policy.rb, line 14 def show? = user&.admin? || record == user
Who is allowed: admins, or the user themselves.
Source
# File app/policies/user_policy.rb, line 17 def suspend? = user&.admin? && record != user
Who is allowed: admins, but not on their own account.
Source
# File app/policies/user_policy.rb, line 12 def update? = user&.admin? && record != user
Who is allowed: admins, but not on their own account — self-demotion is an irreversible lockout on single-admin installs (no user left can manage accounts, and there is no UI path back).