You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# TODO CHANGE LOGIC IT SHOULD LIST POLICIES I CONTROL
-Resource-ResourceTypeIncaseanJWTtokenispassedover, userid, rolesandgroupsareusedtofilterpoliciesthatareonlyvalidforhim. Unlesstheuserissuperadminortenantadmin.
Toreturnpoliciesfromaservicepathtree, youcanusedthewildchar"#".
Forexample, using`/Path1/#`youwillobtainpoliciesforallsubpaths,
suchas: `/Path1/SubPath1`or`/Path1/SubPath1/SubSubPath1`.
"""
user_info = parse_auth_token(token)
owner = None
if user_info and user_info['is_super_admin']:
owner = None
elif user_info and user_info['tenants'] and fiware_service in user_info['tenants'] and "roles" in user_info['tenants'][fiware_service] and "tenant-admin" in user_info['tenants'][fiware_service]["roles"]:
owner = None
elif user_info and user_info['email']:
owner = user_info['email']
# we don't filter policies in case super admin or tenant admin
# TODO CHANGE LOGIC IT SHOULD LIST POLICIES I CONTROL
if agent_type and agent_type not in default.DEFAULT_AGENTS and agent_type not in default.DEFAULT_AGENT_TYPES:
raise HTTPException(
status_code=422,
The text was updated successfully, but these errors were encountered:
chicco785
changed the title
CHANGE LOGIC IT SHOULD LIST POLICIES I CONTROL
read policy when a token is passed should return policies controlled by the user
Oct 27, 2022
anubis/anubis-management-api/anubis/policies/routers.py
Line 339 in 10a293c
The text was updated successfully, but these errors were encountered: