23 lines
563 B
PHP
23 lines
563 B
PHP
<?php
|
|
|
|
namespace MintyPHP\Service\Auth;
|
|
|
|
use MintyPHP\Service\Access\PermissionGateway;
|
|
|
|
class AuthPermissionGateway
|
|
{
|
|
public function __construct(private readonly PermissionGateway $permissionGateway)
|
|
{
|
|
}
|
|
|
|
public function warmUserPermissions(int $userId, bool $forceRefresh = true): array
|
|
{
|
|
return $this->permissionGateway->getUserPermissions($userId, $forceRefresh);
|
|
}
|
|
|
|
public function userHas(int $userId, string $permissionKey): bool
|
|
{
|
|
return $this->permissionGateway->userHas($userId, $permissionKey);
|
|
}
|
|
}
|