Skip to content

Commit

Permalink
Exclude default roles from custom_permissions
Browse files Browse the repository at this point in the history
It makes no sense to duplicate a role that can access everything,
and another that shouldn't access anything.
  • Loading branch information
the-krg committed Aug 25, 2023
1 parent b74d831 commit c256d15
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions core/app/models/spree/permission_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class PermissionSet < Spree::Base
scope :custom_permissions, -> {
where.not(id: display_permissions)
.where.not(id: management_permissions)
.where.not(set: ['Spree::PermissionSets::SuperUser', 'Spree::PermissionSets::DefaultCustomer'])
}
end
end

0 comments on commit c256d15

Please sign in to comment.