2
0
mirror of https://github.com/xcat2/confluent.git synced 2025-01-28 11:57:37 +00:00

Enable non-admin users for web gui

This commit is contained in:
Jarrod Johnson 2022-10-06 08:49:00 -04:00
parent 6eb4bf28e5
commit 3c29a5aa7f
2 changed files with 13 additions and 2 deletions

View File

@ -75,6 +75,7 @@ _allowedbyrole = {
'/node*/configuration/*',
],
'start': [
'/sessions/current/async',
'/nodes/*/console/session*',
'/nodes/*/shell/sessions*',
],
@ -84,10 +85,16 @@ _allowedbyrole = {
],
},
'Monitor': {
'start': [
'/sessions/current/async',
],
'retrieve': [
'/node*/health/hardware',
'/node*/power/state',
'/node*/sensors/*',
'/node*/attributes/current',
'/node*/description',
'/noderange/*/nodes/',
'/nodes/',
'/',
],

View File

@ -451,7 +451,7 @@ def wsock_handler(ws):
mythreadid = greenlet.getcurrent()
httpsessions[sessid]['inflight'].add(mythreadid)
name = httpsessions[sessid]['name']
authdata = auth.authorize(name, ws.path)
authdata = auth.authorize(name, ws.path, operation='start')
if not authdata:
return
cfgmgr = httpsessions[sessid]['cfgmgr']
@ -481,8 +481,12 @@ def wsock_handler(ws):
elif clientmsg[0] == '!':
msg = json.loads(clientmsg[1:])
action = msg.get('operation', None)
targ = msg.get('target', None)
if targ:
authdata = auth.authorize(name, targ, operation=action)
if not authdata:
continue
if action == 'start':
targ = msg['target']
if '/console/session' in targ or '/shell/sessions' in targ:
width = msg['width']
height = msg['height']