mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-02 07:55:16 +00:00
fix: 修改用户授权的资产账号
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
from django.shortcuts import get_object_or_404
|
||||
from rest_framework.generics import ListAPIView, get_object_or_404
|
||||
|
||||
from common.utils import get_logger
|
||||
from common.utils import get_logger, lazyproperty
|
||||
from perms import serializers
|
||||
from perms.hands import Asset
|
||||
from perms.utils import PermAccountUtil
|
||||
@@ -16,11 +16,8 @@ __all__ = [
|
||||
|
||||
class UserGrantedAssetAccountsApi(SelfOrPKUserMixin, ListAPIView):
|
||||
serializer_class = serializers.AccountsGrantedSerializer
|
||||
rbac_perms = (
|
||||
('GET', 'perms.view_userassets'),
|
||||
('list', 'perms.view_userassets'),
|
||||
)
|
||||
|
||||
@lazyproperty
|
||||
def asset(self):
|
||||
asset_id = self.kwargs.get('asset_id')
|
||||
kwargs = {'id': asset_id, 'is_active': True}
|
||||
|
Reference in New Issue
Block a user