refactor(arch): enforce gateway compliance and remove service-wrapping gateways
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace MintyPHP\Service\Access;
|
||||
|
||||
use MintyPHP\Service\Directory\DirectoryScopeGateway;
|
||||
use MintyPHP\Service\Tenant\TenantScopeService;
|
||||
|
||||
class DepartmentAuthorizationPolicy implements AuthorizationPolicyInterface
|
||||
{
|
||||
@@ -13,8 +13,8 @@ class DepartmentAuthorizationPolicy implements AuthorizationPolicyInterface
|
||||
public const ABILITY_ADMIN_DEPARTMENTS_DELETE = 'admin.departments.delete';
|
||||
|
||||
public function __construct(
|
||||
private readonly PermissionGateway $permissionGateway,
|
||||
private readonly DirectoryScopeGateway $scopeGateway
|
||||
private readonly PermissionService $permissionService,
|
||||
private readonly TenantScopeService $scopeGateway
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ class DepartmentAuthorizationPolicy implements AuthorizationPolicyInterface
|
||||
|
||||
private function hasPermission(int $userId, string $permissionKey): bool
|
||||
{
|
||||
return $userId > 0 && $this->permissionGateway->userHas($userId, $permissionKey);
|
||||
return $userId > 0 && $this->permissionService->userHas($userId, $permissionKey);
|
||||
}
|
||||
|
||||
private function capabilitiesFromDecision(AuthorizationDecision $decision): array
|
||||
|
||||
Reference in New Issue
Block a user