Skip to content

Commit

Permalink
fix permission bug (#632)
Browse files Browse the repository at this point in the history
不同的appid下可能有相同的resource type name.
  • Loading branch information
Accelerator96 authored Oct 27, 2024
1 parent 4a3c21e commit 28dca7f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmdb-api/api/lib/perm/acl/permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_all(resource_id=None, group_id=None, need_users=True):

@classmethod
def get_all2(cls, resource_name, resource_type_name, app_id):
rt = ResourceType.get_by(name=resource_type_name, first=True, to_dict=False)
rt = ResourceType.get_by(name=resource_type_name, app_id=app_id, first=True, to_dict=False)
rt or abort(404, ErrFormat.resource_type_not_found.format(resource_type_name))

r = Resource.get_by(name=resource_name, resource_type_id=rt.id, app_id=app_id, first=True, to_dict=False)
Expand Down

0 comments on commit 28dca7f

Please sign in to comment.