Skip to content

Commit

Permalink
readd manage all for superadmins
Browse files Browse the repository at this point in the history
  • Loading branch information
simonfranzen committed Sep 12, 2020
1 parent e0996bb commit ae75e9b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/models/ability.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@ def initialize(user)
return if user.new_record?

if user.superadmin?
can :access, :rails_admin # grant access to rails_admin
end

if user.admin? || user.superadmin?
can :access, :rails_admin # grant access to rails_admin
can :manage, :all # admins can manage all objects
elsif user.admin?
can :crud, User, account_id: user.account_id
else
can :read, User, account_id: user.account_id
Expand Down

0 comments on commit ae75e9b

Please sign in to comment.