summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-10 15:56:13 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-06-13 17:38:44 +0200
commitc2fd182fb6dbfe1f07bccfe1291a006e9d969b94 (patch)
tree150ff3d82ba84e5a85a365390ed73d232d2c94dd /ogcp/views.py
parent454999a895a154fbddd720afee4f49ee8acc0649 (diff)
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.
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 1e2cfac..63f57f0 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -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)