Skip to content
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

Permission checking is skipped due to order of silk_profile decorator #336

Closed
ksdme opened this issue Mar 15, 2019 · 0 comments
Closed

Permission checking is skipped due to order of silk_profile decorator #336

ksdme opened this issue Mar 15, 2019 · 0 comments

Comments

@ksdme
Copy link

ksdme commented Mar 15, 2019

I have been trying to get permissions (using rest_framework.permissions) working with function views decorated in the following order and it won't work unless the order of silk_profile decorator is changed. The permissions are ignored and the view is executed and returns successfully when in the wrong order.

Version that doesn't work:

@api_view(('GET',))
@silk_profile(name='Some View')
@authentication_classes((JSONWebTokenAuthentication,))
@permission_classes((SomeKindOfPermission,))
def some_view(request):
    pass

Version that works:

@api_view(('GET',))
@authentication_classes((JSONWebTokenAuthentication,))
@permission_classes((SomeKindOfPermission,))
@silk_profile(name='Some View')
def some_view(request):
    pass
@auvipy auvipy closed this as completed Apr 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants