test_is_ui_route_allowed

This commit is contained in:
Ishaan Jaff 2024-10-25 10:37:11 +04:00
parent cdb94ffe16
commit 574f07d782
3 changed files with 50 additions and 21 deletions

View file

@ -122,6 +122,11 @@ def _is_ui_route_allowed(
):
# Do something if the current route starts with any of the allowed routes
return True
elif any(
RouteChecks._route_matches_pattern(route=route, pattern=allowed_route)
for allowed_route in allowed_routes
):
return True
else:
if user_obj is not None and _is_user_proxy_admin(user_obj=user_obj):
return True