Browse Source

fix: 修复一些 connection-token rbac 权限控制

pull/9547/head
Bai 2 years ago committed by Jiangjie.Bai
parent
commit
1f4fdc13aa
  1. 2
      apps/authentication/api/connection_token.py
  2. 3
      apps/rbac/builtin.py
  3. 2
      apps/rbac/const.py

2
apps/authentication/api/connection_token.py

@ -218,7 +218,7 @@ class ConnectionTokenViewSet(ExtraActionApiMixin, RootOrgViewMixin, JMSModelView
'list': 'authentication.view_connectiontoken', 'list': 'authentication.view_connectiontoken',
'retrieve': 'authentication.view_connectiontoken', 'retrieve': 'authentication.view_connectiontoken',
'create': 'authentication.add_connectiontoken', 'create': 'authentication.add_connectiontoken',
'expire': 'authentication.add_connectiontoken', 'expire': 'authentication.change_connectiontoken',
'get_rdp_file': 'authentication.add_connectiontoken', 'get_rdp_file': 'authentication.add_connectiontoken',
'get_client_protocol_url': 'authentication.add_connectiontoken', 'get_client_protocol_url': 'authentication.add_connectiontoken',
} }

3
apps/rbac/builtin.py

@ -18,11 +18,10 @@ user_perms = (
('assets', 'asset', 'match', 'asset'), ('assets', 'asset', 'match', 'asset'),
('assets', 'systemuser', 'match', 'systemuser'), ('assets', 'systemuser', 'match', 'systemuser'),
('assets', 'node', 'match', 'node'), ('assets', 'node', 'match', 'node'),
('applications', 'application', 'match', 'application'),
) )
system_user_perms = ( system_user_perms = (
('authentication', 'connectiontoken', 'add,view', 'connectiontoken'), ('authentication', 'connectiontoken', 'add,change,view', 'connectiontoken'),
('authentication', 'temptoken', 'add,change,view', 'temptoken'), ('authentication', 'temptoken', 'add,change,view', 'temptoken'),
('authentication', 'accesskey', '*', '*'), ('authentication', 'accesskey', '*', '*'),
('tickets', 'ticket', 'view', 'ticket'), ('tickets', 'ticket', 'view', 'ticket'),

2
apps/rbac/const.py

@ -22,7 +22,7 @@ exclude_permissions = (
('common', 'setting', '*', '*'), ('common', 'setting', '*', '*'),
('authentication', 'privatetoken', '*', '*'), ('authentication', 'privatetoken', '*', '*'),
('authentication', 'connectiontoken', 'change,delete', 'connectiontoken'), ('authentication', 'connectiontoken', 'delete', 'connectiontoken'),
('authentication', 'ssotoken', '*', '*'), ('authentication', 'ssotoken', '*', '*'),
('authentication', 'superconnectiontoken', 'change,delete', 'superconnectiontoken'), ('authentication', 'superconnectiontoken', 'change,delete', 'superconnectiontoken'),
('authentication', 'temptoken', 'delete', 'temptoken'), ('authentication', 'temptoken', 'delete', 'temptoken'),

Loading…
Cancel
Save