-
Notifications
You must be signed in to change notification settings - Fork 282
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
Add support for generating policies #614
Add support for generating policies #614
Conversation
I really don't like adding more config. Can these be packed down into one config? For example, the default is to use controller authorization unless |
Sure. Do you have a list of possible values for the Edit: Updated the OP with the new syntax. |
Nice. I'll need to update the docs once this is tagged. But I like the syntax. |
Added tests for all the new lexers and generators. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment.
@jasonmccreary think I made all requested changes |
Questions
user_id
,team_id
or role checks.Description
meta.policies=true
is specified then controller authorization according to https://laravel.com/docs/10.x/authorization#authorizing-resource-controllers will be generated and a policy class with all supported methods will be generated.meta.policies=method,method,method
is specified then controller authorization according to https://laravel.com/docs/10.x/authorization#authorizing-actions-using-policies will be generated and a policy class with the specified methods will be generated.Examples
authorizeResource
Input
Output
policies
Input
Output