Uh oh!
There was an error while loading. Please reload this page.
[6.x] Update authorization / permissions - #11516
Merged
Merged
Conversation
…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.
Uh oh!
There was an error while loading. Please reload this page.
duncanmcclean
marked this pull request as ready for review
March 6, 2025 15:25
jasonvarga
requested changes
Mar 6, 2025
Uh oh!
There was an error while loading. Please reload this page.
duncanmccleanforce-pushed
the
super-user-authorization
branch
from
March 7, 2025 12:46
1136551 to
88e702fCompareSince 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.
jasonvarga
commented
Mar 13, 2025
Member
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
This was referenced Sep 2, 2025
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
Sign up for freeto 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::beforetoafter, enabling users to more easily deny access to things.beforein most Statamic policies to continue to avoid overhead when users are super.Closes#8337.
Closes#10832.