File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
superset/stackable/patches/4.0.2 Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11diff --git a/superset/security/OpaSupersetSecurityManager.py b/superset/security/OpaSupersetSecurityManager.py
22new file mode 100644
3- index 0000000000..b3f216c405
3+ index 0000000000..a435572d0e
44--- /dev/null
55+++ b/superset/security/OpaSupersetSecurityManager.py
66@@ -0,0 +1,73 @@
@@ -28,8 +28,8 @@ index 0000000000..b3f216c405
2828+
2929+ opa_roles = set(map(self.resolve_role, opa_role_names))
3030+ logging.info(f'found Roles in Database: {opa_roles}')
31- + # Ensure that in case of a bad or no reponse from OPA each user will have at least one role.
32- + if opa_roles == {None}:
31+ + # Ensure that in case of a bad or no response from OPA each user will have at least one role.
32+ + if opa_roles == {None} or opa_roles == [] :
3333+ opa_roles.add(default_role)
3434+
3535+ if set(user.roles) != opa_roles:
@@ -66,7 +66,7 @@ index 0000000000..b3f216c405
6666+
6767+
6868+ def resolve_opa_endpoint(self) -> Tuple[str, int, bool]:
69- + opa_endpoint = current_app.config.get('STACKABLE_OPA_ENDPOINT ')
69+ + opa_endpoint = current_app.config.get('STACKABLE_OPA_BASE_URL ')
7070+ [protocol, host, port] = opa_endpoint.split(":")
7171+ return host.lstrip('/'), int(port.rstrip('/')), protocol == 'https'
7272+
You can’t perform that action at this time.
0 commit comments