mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-06 10:42:39 +00:00
objects may not have access attributes
This commit is contained in:
parent
f89ef5e3c9
commit
39e6fcdbe4
1 changed files with 2 additions and 2 deletions
|
@ -198,7 +198,7 @@ class CommonRoutingTableImpl(RoutingTable):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Check if user has permission to access this object
|
# Check if user has permission to access this object
|
||||||
if not check_access(obj.identifier, obj.access_attributes, get_auth_attributes()):
|
if not check_access(obj.identifier, getattr(obj, "access_attributes", None), get_auth_attributes()):
|
||||||
logger.debug(f"Access denied to {type} '{identifier}' based on attribute mismatch")
|
logger.debug(f"Access denied to {type} '{identifier}' based on attribute mismatch")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ class CommonRoutingTableImpl(RoutingTable):
|
||||||
filtered_objs = [
|
filtered_objs = [
|
||||||
obj
|
obj
|
||||||
for obj in filtered_objs
|
for obj in filtered_objs
|
||||||
if check_access(obj.identifier, obj.access_attributes, get_auth_attributes())
|
if check_access(obj.identifier, getattr(obj, "access_attributes", None), get_auth_attributes())
|
||||||
]
|
]
|
||||||
|
|
||||||
return filtered_objs
|
return filtered_objs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue