Re: Role Based Access Control for different API methods in Django REST Framework

2019-09-07 Thread gulo loki
in your viewset class,you could rewrite get_permissions to set which permissions you want on action def get_permissions(self, *args, **kwargs): if self.action == 'create': self.permission_classes = (AllowAny,) elif self .action == 'login': self.permiss

Role Based Access Control for different API methods in Django REST Framework

2019-09-07 Thread Azar Mohamed
I am creating REST API for Product, which has following Permission, (create_product, view_product, edit_product). In my Project I am having various users with different roles (Ex: Producer, Retailer, Consumer,...etc). I am assigning permission to individual Roles. I am using Django Group Permiss