-
Notifications
You must be signed in to change notification settings - Fork 328
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Better handling for permission policies on limited admins.
If a limited admin user didn't belong to any groups with the specified permission, then the policy scope could return all results, rather than limiting the results to no results. Luckily, each place these policy scopes were used were also followed by the controller individually checking the policy/permission of individual results, so the unpermitted results ended up getting stripped. This scenario is also tested for in the "assert_default_admin_permissions" tests that apply to our existing API controllers. So while this doesn't change existing behavior, making sure the query returns nothing from the database to begin with seems like a better approach (most of the other policies were already doing this).
- Loading branch information
Showing
3 changed files
with
16 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters