From e5dbb090254268f94cc1ce67aca0e17c4132cd73 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Wed, 21 Feb 2024 16:19:39 +0100 Subject: [PATCH] fix roles --- ereuse_devicehub/modules/did/views.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ereuse_devicehub/modules/did/views.py b/ereuse_devicehub/modules/did/views.py index b45c7411..5aa92576 100644 --- a/ereuse_devicehub/modules/did/views.py +++ b/ereuse_devicehub/modules/did/views.py @@ -62,7 +62,9 @@ class DidView(View): "isOperator": "operator.html", "isVerifier": "verifier.html", "operator": "operator.html", + "Operator": "operator.html", "verifier": "verifier.html", + "Verifier": "verifier.html", } self.template_name = tlmp.get(rol, self.template_name) @@ -87,7 +89,7 @@ class DidView(View): if not g.user.is_authenticated and not rols: return [] - if rols: + if rols and rols != [('', '')]: self.context['rols'] = rols if 'dpp' not in app.blueprints.keys(): @@ -96,7 +98,13 @@ class DidView(View): if not session.get('token_dlt'): return [] + _role = g.user.get_rols_dlt() role = session.get('iota_abac_attributes', {}).get('role', '') + + if not role and _role: + self.context['rols'] = [(x, x) for x in _role + return + if not role: return [] self.context['rols'] = [(x.strip(), x.strip()) for x in role.split(",")]