vintasoftware / django-role-permissions

A django app for role based permissions.
http://django-role-permissions.readthedocs.org/
MIT License
728 stars 114 forks source link

Different permission for DRF CRUD #121

Open sandeepbalagopal09 opened 4 years ago

sandeepbalagopal09 commented 4 years ago

I am looking for a solution to check the permission in ModelViewSet so that each of Create, Read, Update and Delete permissions are checked separately.

That is, say if somebody trying to access the api for create an object on MyModel, then the permission should check for django's inbuilt add_mymodel permission. I have a role create with this permission added to it. But couldn't find an option to do it using the provided HasPermissionsMixin mixin. note that I want to check similarly change_mymodel, view_mymodel, delete_mymodel based on the action performed in the api.

filipeximenes commented 4 years ago

We currently don't support this. You'd need to write a custom solution for it. Happy to discuss in case you want to propose a solution to be merged.

vaishnavi-2901 commented 5 months ago

I can take it, please assign this issue to me

fjsj commented 5 months ago

Please propose a reusable solution here first @vishu1089