refactor(reporting): reuse exact principal projection contract
Module Package Release / publish-packages (push) Successful in 15s
Module Package Release / publish-packages (push) Successful in 15s
Release v0.1.22. Coordinated integrity review: GovOPlaN/govoplan-core#298.
This commit is contained in:
@@ -10,6 +10,7 @@ import uuid
|
||||
from sqlalchemy import and_, exists, func, or_
|
||||
from sqlalchemy.orm import Query, Session
|
||||
|
||||
from govoplan_core.core.principal_helpers import principal_actor_ids as _actor_ids
|
||||
from govoplan_core.core.events import (
|
||||
EventActorRef,
|
||||
EventObjectRef,
|
||||
@@ -884,22 +885,6 @@ def _actor(principal: object) -> str | None:
|
||||
return None
|
||||
|
||||
|
||||
def _actor_ids(principal: object) -> tuple[str, ...]:
|
||||
user = getattr(principal, "user", None)
|
||||
return tuple(
|
||||
dict.fromkeys(
|
||||
str(value)
|
||||
for value in (
|
||||
getattr(principal, "account_id", None),
|
||||
getattr(principal, "identity_id", None),
|
||||
getattr(principal, "membership_id", None),
|
||||
getattr(user, "id", None),
|
||||
)
|
||||
if str(value or "").strip()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def _principal_tenant(principal: object) -> str:
|
||||
tenant_id = str(getattr(principal, "tenant_id", "") or "").strip()
|
||||
if not tenant_id:
|
||||
|
||||
@@ -83,7 +83,7 @@ from govoplan_reporting.backend.search_source import create_reporting_search_sou
|
||||
|
||||
MODULE_ID = "reporting"
|
||||
MODULE_NAME = "Reporting"
|
||||
MODULE_VERSION = "0.1.21"
|
||||
MODULE_VERSION = "0.1.22"
|
||||
|
||||
|
||||
def _permission(scope: str, label: str, description: str) -> PermissionDefinition:
|
||||
|
||||
Reference in New Issue
Block a user