File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
libs/labelbox/src/labelbox/schema Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -258,7 +258,7 @@ def _get_available_api_key_roles(client: "Client") -> List[str]:
258258 if role ["name" ] in ["None" , "Tenant Admin" ]:
259259 continue
260260 if all (perm in current_permissions for perm in role ["permissions" ]):
261- available_roles .append (format_role ( role ["name" ]) )
261+ available_roles .append (role ["name" ])
262262 client ._cached_available_api_key_roles = available_roles
263263 return available_roles
264264
@@ -332,9 +332,8 @@ def create_api_key(
332332 raise ValueError ("role must be a Role object or a valid role name" )
333333
334334 allowed_roles = ApiKey ._get_available_api_key_roles (client )
335- # Format the input role name consistently with available roles
336- formatted_role_name = format_role (role_name )
337- if formatted_role_name not in allowed_roles :
335+ # Check if the role name exactly matches one of the allowed roles (case-sensitive)
336+ if role_name not in allowed_roles :
338337 raise ValueError (
339338 f"Invalid role specified. Allowed roles are: { allowed_roles } "
340339 )
You can’t perform that action at this time.
0 commit comments