You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use HasRoleMixin and HasPermissionsMixin on class based views. My endpoint always responds with PermissionDenied But with Decorators work correctly on function based views.
@permission_classes((IsAuthenticated, ))
class CompanyList(HasPermissionsMixin, generics.ListAPIView):
required_permission = 'company_list'
Hi @aquinovo maybe the role permissions mixin is not playing well with the permission_classes decorator. Could you try using it with the permission_classes class attribute instead?
When I use HasRoleMixin and HasPermissionsMixin on class based views. My endpoint always responds with PermissionDenied But with Decorators work correctly on function based views.
@permission_classes((IsAuthenticated, ))
class CompanyList(HasPermissionsMixin, generics.ListAPIView):
required_permission = 'company_list'
@permission_classes((IsAuthenticated, ))
@has_permission_decorator('get_user')
def get_user(request):
The text was updated successfully, but these errors were encountered: