mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-10-24 17:34:04 +00:00
refactor: 重构资产授权工具、资产授权账号工具类;删除Model中的处理逻辑;增加用户组、资产授权账号的获取方式
This commit is contained in:
@@ -22,6 +22,7 @@ from common.utils import get_logger, lazyproperty
|
||||
from perms.hands import User, Asset, Account
|
||||
from perms import serializers
|
||||
from perms.models import AssetPermission, Action
|
||||
from perms.utils import PermAccountUtil
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
@@ -118,7 +119,9 @@ class UserGrantedAssetAccountsApi(ListAPIView):
|
||||
return asset
|
||||
|
||||
def get_queryset(self):
|
||||
accounts = AssetPermission.get_perm_asset_accounts(user=self.user, asset=self.asset)
|
||||
accounts = PermAccountUtil().get_perm_accounts_for_user_asset(
|
||||
self.user, self.asset, with_actions=True
|
||||
)
|
||||
return accounts
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user