mirror of
https://github.com/jumpserver/jumpserver.git
synced 2026-01-29 21:51:31 +00:00
perf: 修改 connection token
This commit is contained in:
5
apps/perms/api/perm_token.py
Normal file
5
apps/perms/api/perm_token.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from rest_framework.viewsets import ModelViewSet
|
||||
|
||||
|
||||
class PermTokenViewSet(ModelViewSet):
|
||||
pass
|
||||
@@ -17,10 +17,8 @@ class PermAccountUtil(AssetPermissionUtil):
|
||||
"""
|
||||
permed_accounts = self.get_permed_accounts_for_user(user, asset)
|
||||
accounts_mapper = {account.username: account for account in permed_accounts}
|
||||
|
||||
account = accounts_mapper.get(account_username)
|
||||
actions, date_expired = (account.actions, account.date_expired) if account else (False, None)
|
||||
return actions, date_expired
|
||||
return account
|
||||
|
||||
def get_permed_accounts_for_user(self, user, asset):
|
||||
""" 获取授权给用户某个资产的账号 """
|
||||
|
||||
Reference in New Issue
Block a user