diff --git a/forms-flow-api-utils/src/formsflow_api_utils/utils/user_context.py b/forms-flow-api-utils/src/formsflow_api_utils/utils/user_context.py index ff2a16d6d..062f2b81d 100644 --- a/forms-flow-api-utils/src/formsflow_api_utils/utils/user_context.py +++ b/forms-flow-api-utils/src/formsflow_api_utils/utils/user_context.py @@ -60,11 +60,12 @@ def groups(self) -> List[str]: @property def group_or_roles(self) -> List[str]: """Return groups is env is using groups, else roles.""" - return ( - self._roles - if current_app.config.get("KEYCLOAK_ENABLE_CLIENT_AUTH") - else self._groups - ) + if current_app.config.get( + "KEYCLOAK_ENABLE_CLIENT_AUTH" + ) and not current_app.config.get("MULTI_TENANCY_ENABLED"): + return self._roles + else: + return self._groups def user_context(function):