From ed7ab50b7a6d6366286df1894f7334c9eeac4378 Mon Sep 17 00:00:00 2001 From: spsaefan <117728614+spsaefan@users.noreply.github.com> Date: Mon, 13 Jul 2026 23:18:53 +0200 Subject: [PATCH] Allow managers to load own organization --- .../src/main/inse/account_management/service.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/service/src/main/inse/account_management/service.py b/service/src/main/inse/account_management/service.py index 0b4a65f7..2c4510bd 100644 --- a/service/src/main/inse/account_management/service.py +++ b/service/src/main/inse/account_management/service.py @@ -225,9 +225,19 @@ def list_organizations( .where(Organization.deleted.is_not(True)) .order_by(Organization.name) ).all() - elif access_token.effective_role == UserRole.ADMIN: - organization = session.get(Organization, access_token.effective_organization_id) - organizations = [organization] if organization and not organization.deleted else [] + elif access_token.effective_role in { + UserRole.ADMIN, + UserRole.MANAGER, + }: + organization = session.get( + Organization, + access_token.effective_organization_id, + ) + organizations = ( + [organization] + if organization and not organization.deleted + else [] + ) else: raise HTTPException(status_code=status.HTTP_403_FORBIDDEN) -- 2.56.1