forked from fa/breadcrumb-the-shire
29 lines
694 B
PHP
29 lines
694 B
PHP
<?php
|
|
|
|
namespace MintyPHP\Service\User;
|
|
|
|
use MintyPHP\Service\Tenant\TenantScopeService;
|
|
|
|
class UserScopeGateway
|
|
{
|
|
public function __construct(
|
|
private readonly TenantScopeService $tenantScopeService
|
|
) {
|
|
}
|
|
|
|
public function hasGlobalAccess(int $userId): bool
|
|
{
|
|
return $this->tenantScopeService->hasGlobalAccess($userId);
|
|
}
|
|
|
|
public function canAccess(string $resourceType, int $resourceId, int $userId): bool
|
|
{
|
|
return $this->tenantScopeService->canAccess($resourceType, $resourceId, $userId);
|
|
}
|
|
|
|
public function getUserTenantIds(int $userId): array
|
|
{
|
|
return $this->tenantScopeService->getUserTenantIds($userId);
|
|
}
|
|
}
|