Skip to content

Add permissions.OperandHolder to decorators.permission_classes signature #162

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 3 commits into from
Aug 3, 2021
Merged

Add permissions.OperandHolder to decorators.permission_classes signature #162

merged 3 commits into from
Aug 3, 2021

Conversation

kontsaki
Copy link
Contributor

@kontsaki kontsaki commented Aug 3, 2021

Hello, this will allow permission_classes to accept types like BasePermission & BasePermission.
i am not sure if i should import _PermissionsClasses as defined in the permissions stub and remove the preceding underscore, feedback is appreciated.

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks! Let's add a test for this!

@kontsaki
Copy link
Contributor Author

kontsaki commented Aug 3, 2021

oh yes, on it.

@kontsaki
Copy link
Contributor Author

kontsaki commented Aug 3, 2021

would a test like this suffice ?


- case: permission_classes
main: |
from rest_framework.decorators import permission_classes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to test that & form works. You can also add tests for other ways if

  • they are missing
  • you have the time for it 🙂

@kontsaki
Copy link
Contributor Author

kontsaki commented Aug 3, 2021

i can add more tests if you have something else in mind

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sobolevn sobolevn merged commit 8ba53c7 into typeddjango:master Aug 3, 2021
@kontsaki kontsaki deleted the permission-classes branch August 3, 2021 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants