views: allow scope server data in restricted user mode

Add the server scope during scope filtering for user accounts
with restricted scope access.
The HTML server scope component in the sidebar holds important
information as a hidden component. The removal of the server
scope also removes the respective HTML component in the web.
Missing server scopes result in a backtrace while trying to get
data such as server IP.
master
Alejandro Sirgo Rica 2024-06-10 15:56:13 +02:00
parent 454999a895
commit c2fd182fb6
1 changed files with 1 additions and 1 deletions

View File

@ -221,7 +221,7 @@ def add_state_and_ips(scope, clients, ips):
def get_allowed_scopes(scopes, allowed_scopes):
for scope in scopes.get('scope'):
if scope.get('name') in current_user.scopes:
if scope.get('name') in current_user.scopes or scope.get('type') == 'server':
allowed_scopes.append(scope)
else:
get_allowed_scopes(scope, allowed_scopes)