changes to the user authentification
Release Inventarsystem / release-docker (push) Successful in 2m17s
Release Inventarsystem / release-docker (push) Successful in 2m17s
This commit is contained in:
@@ -824,13 +824,10 @@ def _action_access_allowed(permissions, action_key):
|
|||||||
def _permission_denied_fallback_endpoint(permissions, current_endpoint=None):
|
def _permission_denied_fallback_endpoint(permissions, current_endpoint=None):
|
||||||
username = session.get('username')
|
username = session.get('username')
|
||||||
is_admin_user = bool(username and us.check_admin(username))
|
is_admin_user = bool(username and us.check_admin(username))
|
||||||
admin_home_allowed = _page_access_allowed(permissions, 'home_admin') and _action_access_allowed(permissions, 'can_manage_settings')
|
|
||||||
|
|
||||||
for candidate in ('my_borrowed_items', 'tutorial_page', 'notifications_view', 'impressum', 'home_admin'):
|
for candidate in ('my_borrowed_items', 'tutorial_page', 'notifications_view', 'impressum', 'home_admin'):
|
||||||
if current_endpoint and candidate == current_endpoint:
|
if current_endpoint and candidate == current_endpoint:
|
||||||
continue
|
continue
|
||||||
if candidate == 'home_admin' and is_admin_user and not admin_home_allowed:
|
|
||||||
continue
|
|
||||||
if _page_access_allowed(permissions, candidate):
|
if _page_access_allowed(permissions, candidate):
|
||||||
return candidate
|
return candidate
|
||||||
return 'logout'
|
return 'logout'
|
||||||
|
|||||||
Reference in New Issue
Block a user