-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
[feature] Add class to implement view permissions in DRF #249
Comments
Update: there's a an issue in django-rest-framework for this: |
Legends:
Hi, @nemesisdesign thise are the permission of different user:-
The user's marked as ❎ is not allowed to create objects. Here the issue which @atb00ker pointed out 👉 openwisp/openwisp-controller#386 (comment) and how will we check on permissions to solve this this issue, Is not related to being a orgniazatin manager or not? |
Copy from Gitter response This is what I wanted to explain 👍 |
DRF DjangoModelPermission does not takes into account the view permissions, and hence any user is allowed to view the objects even though they may not have view permission or change permission on that specific object.
We recently dealt with this in openwisp-network-topology, we could use a similar solution, adapted to be more generic:
https://github.com/openwisp/openwisp-network-topology/blob/3c3404748a9ecab65f3f4a389f94d2c75fbde732/openwisp_network_topology/api/views.py#L31-L51.
I think we could extend
DjangoModelPermissions
and add our logic so that:Here's a few possible tests explained below.
Preconditions:
Tests:
The text was updated successfully, but these errors were encountered: