fix: 修复资产详情 查看授权用户500问题 (#8963)

Co-authored-by: 小冯 <xiaofeng@xiaofengdeMacBook-Pro.local>
pull/8964/head
fit2bot 2 years ago committed by GitHub
parent db2ab1513e
commit 33860bb955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -118,7 +118,7 @@ class NodesRelationMixin:
_nodes = node.get_ancestors(with_self=True)
nodes.extend(list(_nodes))
if flat:
nodes = list(reduce(lambda x, y: set(x) | set(y), nodes))
nodes = list(set([node.id for node in nodes]))
return nodes

@ -121,8 +121,8 @@ class RBACPermission(permissions.DjangoModelPermissions):
if request.user.is_anonymous and self.authenticated_users_only:
return False
raw_action = getattr(view, 'raw_action', None)
if raw_action == 'metadata':
raw_action = getattr(view, 'raw_action', request.method)
if raw_action in ['metadata', 'OPTIONS']:
return True
perms = self.get_require_perms(request, view)

Loading…
Cancel
Save