-
-
Notifications
You must be signed in to change notification settings - Fork 571
[6.x] Update authorization / permissions #11516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or 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
…tatamic permission
Otherwise, when the `Authorize` middleware checks if the user has access to the CP, `Permission:all()` in the `Gate::before()` closure won't return any permissions as they haven't been booted yet.
Until I figure out a better solution. 🤔
Since there's no `DroidsClass` policy, I've updated this test to authorize using a permission instead, which'll work.
duncanmcclean
commented
Feb 28, 2025
jasonvarga
requested changes
Mar 6, 2025
1136551
to
88e702f
Compare
Since more stuff gets evaluated now (all the permissions are compiled) all the sites will be looped over. Many tests were setting up sites without explicit names. They don't really need them so here the site name will fall back to the handle.
Since we're checking whether an ability is a Statamic one, I had to add a way to get all the resolved permissions. The Permission::all() you had there wouldn't work since it would include placeholders. e.g. |
…egistered statamic permission
…e we want code coverage for that.
This was referenced Mar 13, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request:
Gate::before
toafter
, enabling users to more easily deny access to things.before
in most Statamic policies to continue to avoid overhead when users are super.Closes #8337.
Closes #10832.