rbac: fix missing permission definition for list
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
@ -7,6 +7,16 @@ from rest_framework.request import Request
|
||||
class ObjectPermissions(DjangoObjectPermissions):
|
||||
"""RBAC Permissions"""
|
||||
|
||||
perms_map = {
|
||||
"GET": ["%(app_label)s.view_%(model_name)s"],
|
||||
"OPTIONS": [],
|
||||
"HEAD": [],
|
||||
"POST": ["%(app_label)s.add_%(model_name)s"],
|
||||
"PUT": ["%(app_label)s.change_%(model_name)s"],
|
||||
"PATCH": ["%(app_label)s.change_%(model_name)s"],
|
||||
"DELETE": ["%(app_label)s.delete_%(model_name)s"],
|
||||
}
|
||||
|
||||
def has_object_permission(self, request: Request, view, obj: Model):
|
||||
queryset = self._queryset(view)
|
||||
model_cls = queryset.model
|
||||
|
Reference in New Issue
Block a user