refactor(arch): enforce gateway compliance and remove service-wrapping gateways
This commit is contained in:
@@ -41,7 +41,7 @@ $filterState = gridParseFilters($query, [
|
||||
]);
|
||||
|
||||
$currentUserId = (int) ($session['user']['id'] ?? 0);
|
||||
$allowedTenantIds = app(\MintyPHP\Service\Directory\DirectoryScopeGateway::class)->getUserTenantIds($currentUserId);
|
||||
$allowedTenantIds = app(\MintyPHP\Service\Tenant\TenantScopeService::class)->getUserTenantIds($currentUserId);
|
||||
$uiAccessService = app(UiAccessService::class);
|
||||
$selfEditDecision = $authorizationService->authorize(UserAuthorizationPolicy::ABILITY_ADMIN_USERS_EDIT_CONTEXT, [
|
||||
'actor_user_id' => $currentUserId,
|
||||
@@ -70,7 +70,7 @@ if ($allowedTenantIds) {
|
||||
$tenantId = (int) ($tenant['id'] ?? 0);
|
||||
return $tenantId > 0 && in_array($tenantId, $allowedTenantIds, true);
|
||||
}));
|
||||
} elseif (app(\MintyPHP\Service\Directory\DirectoryScopeGateway::class)->isStrict()) {
|
||||
} elseif (app(\MintyPHP\Service\Tenant\TenantScopeService::class)->isStrict()) {
|
||||
$tenants = [];
|
||||
}
|
||||
sortByDescription($tenants);
|
||||
@@ -79,7 +79,7 @@ $roles = app(\MintyPHP\Service\Access\RoleService::class)->listActive();
|
||||
sortByDescription($roles);
|
||||
|
||||
$departments = $allowedTenantIds ? app(\MintyPHP\Service\Org\DepartmentService::class)->listByTenantIds($allowedTenantIds) : [];
|
||||
if (!$allowedTenantIds && !app(\MintyPHP\Service\Directory\DirectoryScopeGateway::class)->isStrict()) {
|
||||
if (!$allowedTenantIds && !app(\MintyPHP\Service\Tenant\TenantScopeService::class)->isStrict()) {
|
||||
$departments = app(\MintyPHP\Service\Org\DepartmentService::class)->list();
|
||||
}
|
||||
sortByDescription($departments);
|
||||
|
||||
Reference in New Issue
Block a user