refactor(arch): enforce gateway compliance and remove service-wrapping gateways

This commit is contained in:
2026-03-13 11:31:33 +01:00
parent 082fa4c9a5
commit 892da0048d
96 changed files with 1117 additions and 1060 deletions

View File

@@ -7,6 +7,7 @@ use MintyPHP\Repository\Org\UserDepartmentRepositoryInterface;
use MintyPHP\Repository\Support\DatabaseSessionRepository;
use MintyPHP\Repository\Tenant\UserTenantRepositoryInterface;
use MintyPHP\Repository\User\UserWriteRepositoryInterface;
use MintyPHP\Service\Access\PermissionService;
class UserAssignmentService
{
@@ -16,7 +17,7 @@ class UserAssignmentService
private readonly UserRoleRepositoryInterface $userRoleRepository,
private readonly UserDepartmentRepositoryInterface $userDepartmentRepository,
private readonly UserDirectoryGateway $directoryGateway,
private readonly UserPermissionGateway $permissionGateway,
private readonly PermissionService $permissionService,
private readonly DatabaseSessionRepository $databaseSessionRepository
) {
}
@@ -181,7 +182,7 @@ class UserAssignmentService
$ids = array_values(array_filter($ids, static fn ($id) => isset($validMap[$id])));
}
$result = $this->userRoleRepository->replaceForUser($userId, $ids);
$this->permissionGateway->clearUserCache($userId);
$this->permissionService->clearUserCache($userId);
if ($result && $bumpAuthz) {
$this->bumpAuthzVersion($userId);
}