Unverified Commit deeb9cdf authored by BaiJiangJie's avatar BaiJiangJie Committed by GitHub

Merge pull request #3564 from jumpserver/dev_bai

[Update] 修改校验用户资产权限API不使用缓存
parents 15d1e021 7a6a1b9b
......@@ -59,6 +59,9 @@ class GetUserAssetPermissionActionsApi(UserAssetPermissionMixin,
class ValidateUserAssetPermissionApi(UserAssetPermissionMixin, APIView):
permission_classes = (IsOrgAdminOrAppUser,)
def get_cache_policy(self):
return 0
def get_obj(self):
user_id = self.request.query_params.get('user_id', '')
user = get_object_or_404(User, id=user_id)
......
......@@ -10,9 +10,12 @@ from ...hands import Node, Asset
class UserAssetPermissionMixin(UserPermissionMixin):
util = None
def get_cache_policy(self):
return self.request.query_params.get('cache_policy', '0')
@lazyproperty
def util(self):
cache_policy = self.request.query_params.get('cache_policy', '0')
cache_policy = self.get_cache_policy()
system_user_id = self.request.query_params.get("system_user")
util = AssetPermissionUtilV2(self.obj, cache_policy=cache_policy)
if system_user_id:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment