Set the allowed roles for user on invitation

This commit is contained in:
Dita Aji Pratama 2025-08-13 08:26:05 +07:00
parent 7676fb2813
commit 029388ddc8

View File

@ -20,6 +20,15 @@ class users:
user_validation = procedure_validation.validation().account(APIADDR, allowed_roles) user_validation = procedure_validation.validation().account(APIADDR, allowed_roles)
user = user_validation['data'] user = user_validation['data']
allowed_grant = globalvar.allowed_grant
allow = list({
row
for role in user["profile"]["roles"]
for grant in allowed_grant
if grant["roles"] == role
for row in grant["allowed"]
})
return Template(params["mako"]["website"]['index']).render( return Template(params["mako"]["website"]['index']).render(
title = globalvar.title, title = globalvar.title,
header = globalvar.header, header = globalvar.header,
@ -32,6 +41,7 @@ class users:
copyright = globalvar.copyright, copyright = globalvar.copyright,
), ),
container = Template(params["mako"]["website"]['container']).render( container = Template(params["mako"]["website"]['container']).render(
token = user['token'] token = user['token'],
allow = allow
) )
) )