We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I was thinking about having the following two options:
Not sure if we need both, worth investigating for sure.
Something like this:
import strawberry @strawberry.type(permission_classes=[AdminOnly, CurrentUser]) class User: id: strawberry.ID email: str
For this to work we need to hook into the resolvers and make sure we check the permissions of the returned object.
I see some complexity with interfaces and unions.
Also we might need to think about pre/post permissions (permission that run before the resolver and permissions that run after)
This might be easier to implement, and it would look like this:
import strawberry @strawberry.type(default_field_permission_classes=[AdminOnly, CurrentUser]) class User: id: strawberry.ID email: str name: str = strawberry.field(permission_classes=[])
(I don't like the long name)
This would basically change the permission classes for all the fields of this class, unless they already have a permission classes list set.
For something I'm working on this would be more useful than the first option.
I'm interested in people's opinion, I'd love to know what you think it's better to have :D
The text was updated successfully, but these errors were encountered:
default_permissions should suffice
default_permissions
The rest is intuitive. Nothing other than the fields could have the permisson.
Add in the docs that you can only pass permission classes. Should be clear as day!
Sorry, something went wrong.
No branches or pull requests
I was thinking about having the following two options:
Not sure if we need both, worth investigating for sure.
Permission on types
Something like this:
For this to work we need to hook into the resolvers and make sure we check the permissions of the returned object.
I see some complexity with interfaces and unions.
Also we might need to think about pre/post permissions (permission that run before the resolver and permissions that run after)
Default field permissions on types
This might be easier to implement, and it would look like this:
(I don't like the long name)
This would basically change the permission classes for all the fields of this class, unless they already have a permission classes list set.
For something I'm working on this would be more useful than the first option.
I'm interested in people's opinion, I'd love to know what you think it's better to have :D
The text was updated successfully, but these errors were encountered: