Files
breadcrumb-the-shire/lib/Service/Auth/AuthScopeGateway.php

34 lines
917 B
PHP
Raw Normal View History

2026-02-23 12:58:19 +01:00
<?php
namespace MintyPHP\Service\Auth;
use MintyPHP\Service\Tenant\TenantScopeService;
class AuthScopeGateway
{
2026-03-04 15:56:58 +01:00
public function __construct(
private readonly TenantScopeService $tenantScopeService
) {
2026-02-23 12:58:19 +01:00
}
public function hasGlobalAccess(int $userId): bool
{
2026-03-04 15:56:58 +01:00
return $this->tenantScopeService->hasGlobalAccess($userId);
2026-02-23 12:58:19 +01:00
}
public function getUserTenantIds(int $userId): array
{
2026-03-04 15:56:58 +01:00
return $this->tenantScopeService->getUserTenantIds($userId);
2026-02-23 12:58:19 +01:00
}
public function canAccess(string $resourceType, int $resourceId, int $userId): bool
{
2026-03-04 15:56:58 +01:00
return $this->tenantScopeService->canAccess($resourceType, $resourceId, $userId);
2026-02-23 12:58:19 +01:00
}
public function resourceBelongsToTenant(string $resourceType, int $resourceId, int $tenantId): bool
{
2026-03-04 15:56:58 +01:00
return $this->tenantScopeService->resourceBelongsToTenant($resourceType, $resourceId, $tenantId);
2026-02-23 12:58:19 +01:00
}
}