mirror of https://github.com/jumpserver/jumpserver
fix: 修改rbac permission
parent
1a05a942c2
commit
dfe5e2bce3
|
@ -66,8 +66,10 @@ class RBACPermission(permissions.DjangoModelPermissions):
|
|||
perms = {}
|
||||
if hasattr(view, 'rbac_perms'):
|
||||
perms.update(dict(view.rbac_perms))
|
||||
default_perms = self.get_default_action_perms(model_cls)
|
||||
if '*' not in perms:
|
||||
perms.update(self.get_default_action_perms(model_cls))
|
||||
for k, v in default_perms.items():
|
||||
perms.setdefault(k, v)
|
||||
return perms
|
||||
|
||||
def _get_action_perms(self, action, model_cls, view):
|
||||
|
@ -107,6 +109,7 @@ class RBACPermission(permissions.DjangoModelPermissions):
|
|||
if not action:
|
||||
action = request.method
|
||||
perms = self._get_action_perms(action, model_cls, view)
|
||||
print(model_cls, perms, action)
|
||||
return perms
|
||||
|
||||
def has_permission(self, request, view):
|
||||
|
|
Loading…
Reference in New Issue