From f19f28cf3eb7590937b8f9f4335b153a0b1dcf16 Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Tue, 16 Jul 2019 13:24:16 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E8=8E=B7=E5=8F=96=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=8E=88=E6=9D=83=E8=B5=84=E4=BA=A7=E6=97=B6=E5=8F=AA=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E8=B5=84=E4=BA=A7=E5=8D=8F=E8=AE=AE=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=9A=84=E7=B3=BB=E7=BB=9F=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/perms/api/mixin.py | 2 ++ apps/perms/api/user_permission.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/apps/perms/api/mixin.py b/apps/perms/api/mixin.py index 24bd9abd2..9c726691f 100644 --- a/apps/perms/api/mixin.py +++ b/apps/perms/api/mixin.py @@ -174,6 +174,8 @@ class GrantAssetsMixin(LabelFilterMixin): system_user = system_users_map.get(sid) if not system_user: continue + if not asset.has_protocol(system_user.protocol): + continue system_user.actions = action system_users_granted.append(system_user) asset.system_users_granted = system_users_granted diff --git a/apps/perms/api/user_permission.py b/apps/perms/api/user_permission.py index 0746252cb..13ee07951 100644 --- a/apps/perms/api/user_permission.py +++ b/apps/perms/api/user_permission.py @@ -256,6 +256,8 @@ class UserGrantedNodesWithAssetsApi(UserPermissionCacheMixin, NodesWithUngroupMi system_user = _system_users_map.get(system_user_id) if not system_user: continue + if not asset.has_protocol(system_user.protocol): + continue system_user.actions = action system_user_granted.append(system_user) asset.system_users_granted = system_user_granted