From 39e6fcdbe4e951e2d7e1cc52d238207b4229233d Mon Sep 17 00:00:00 2001 From: Ashwin Bharambe Date: Thu, 20 Mar 2025 19:58:28 -0700 Subject: [PATCH] objects may not have access attributes --- llama_stack/distribution/routers/routing_tables.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/llama_stack/distribution/routers/routing_tables.py b/llama_stack/distribution/routers/routing_tables.py index 140e6de76..d444b03a3 100644 --- a/llama_stack/distribution/routers/routing_tables.py +++ b/llama_stack/distribution/routers/routing_tables.py @@ -198,7 +198,7 @@ class CommonRoutingTableImpl(RoutingTable): return None # 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") return None @@ -244,7 +244,7 @@ class CommonRoutingTableImpl(RoutingTable): filtered_objs = [ obj 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