feat: add access module boundary migrations

This commit is contained in:
2026-07-10 12:51:16 +02:00
parent 37828fe340
commit 04681f1d75
41 changed files with 7229 additions and 738 deletions

View File

@@ -20,6 +20,7 @@ from govoplan_access.backend.db.models import (
UserGroupMembership,
UserRoleAssignment,
)
from govoplan_access.backend.semantic import ensure_identity_for_account
from govoplan_access.backend.security.passwords import hash_password
from govoplan_core.security.permissions import (
DEFAULT_SYSTEM_ROLES,
@@ -98,6 +99,7 @@ def get_or_create_account(
raise AdminConflictError(
"The global account is disabled. A system administrator must reactivate it before adding a tenant membership."
)
ensure_identity_for_account(session, account)
return account, False, None
temporary_password = password or generate_temporary_password()
@@ -112,6 +114,7 @@ def get_or_create_account(
)
session.add(account)
session.flush()
ensure_identity_for_account(session, account)
return account, True, temporary_password