<?php

namespace MintyPHP\Service\Access;

class PermissionGateway
{
    public function __construct(private readonly PermissionService $permissionService)
    {
    }

    public function userHas(int $userId, string $permissionKey): bool
    {
        return $this->permissionService->userHas($userId, $permissionKey);
    }

    public function getUserPermissions(int $userId, bool $refresh = false): array
    {
        return $this->permissionService->getUserPermissions($userId, $refresh);
    }

    public function getCachedPermissions(int $userId): array
    {
        return $this->permissionService->getCachedPermissions($userId);
    }

    public function clearUserCache(int $userId): void
    {
        $this->permissionService->clearUserCache($userId);
    }

    public function listPaged(array $options): array
    {
        return $this->permissionService->listPaged($options);
    }

    public function find(int $id): ?array
    {
        return $this->permissionService->find($id);
    }

    public function createFromAdmin(array $input): array
    {
        return $this->permissionService->createFromAdmin($input);
    }

    public function updateFromAdmin(int $id, array $input): array
    {
        return $this->permissionService->updateFromAdmin($id, $input);
    }

    public function deleteById(int $id): array
    {
        return $this->permissionService->deleteById($id);
    }
}
