mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-03 00:15:20 +00:00
perf: some risk example file path
This commit is contained in:
@@ -16,10 +16,11 @@ class RBACBackend(JMSBaseAuthBackend):
|
||||
return False
|
||||
|
||||
def has_perm(self, user_obj, perm, obj=None):
|
||||
# 扫描软件对 * 毕竟敏感,所以改成 none, 虽说这个 * 是我们自定义的标识
|
||||
if perm == 'none':
|
||||
return True
|
||||
if not user_obj.is_active or not perm:
|
||||
raise PermissionDenied()
|
||||
if perm == '*':
|
||||
return True
|
||||
if isinstance(perm, str):
|
||||
perm_set = set(i.strip() for i in perm.split('|'))
|
||||
elif isinstance(perm, (list, tuple, set)):
|
||||
|
@@ -16,10 +16,10 @@ class RBACPermission(permissions.DjangoModelPermissions):
|
||||
('bulk_update', '%(app_label)s.change_%(model_name)s'),
|
||||
('partial_bulk_update', '%(app_label)s.change_%(model_name)s'),
|
||||
('bulk_destroy', '%(app_label)s.delete_%(model_name)s'),
|
||||
('render_to_json', '*'),
|
||||
('metadata', '*'),
|
||||
('render_to_json', 'none'),
|
||||
('metadata', 'none'),
|
||||
('GET', '%(app_label)s.view_%(model_name)s'),
|
||||
('OPTIONS', '*'),
|
||||
('OPTIONS', 'none'),
|
||||
('HEAD', '%(app_label)s.view_%(model_name)s'),
|
||||
('POST', '%(app_label)s.add_%(model_name)s'),
|
||||
('PUT', '%(app_label)s.change_%(model_name)s'),
|
||||
|
Reference in New Issue
Block a user