• Full name: \App\Infrastructure\Services\User\UserAuth
  • This class is marked as final and can't be subclassed
  • This class implements: Gate
  • This class is a Final class

Properties

rbac

protected \Codefy\Framework\Auth\Rbac\Rbac $rbac

user

protected \Codefy\Framework\Auth\Repository\AuthUserRepository $user

Methods

__construct

public __construct(\Codefy\Framework\Auth\Rbac\Rbac $rbac, \Codefy\Framework\Auth\Repository\AuthUserRepository $user): mixed

Parameters:

Parameter Type Description
$rbac \Codefy\Framework\Auth\Rbac\Rbac
$user \Codefy\Framework\Auth\Repository\AuthUserRepository

can

public can(string $permissionName, array $ruleParams = []): bool

Parameters:

Parameter Type Description
$permissionName string
$ruleParams array

current

public current(): bool|null|object

hasAuthenticatedUser

Whether user is authenticated.

private hasAuthenticatedUser(): bool

resolveUserByToken

private resolveUserByToken(string $token): object|bool|null

Parameters:

Parameter Type Description
$token string

getRoles

private getRoles(): array<string,\Codefy\Framework\Auth\Rbac\Entity\Role>

Throws:


guest

public guest(): bool

isLoggedIn

public isLoggedIn(): bool

getToken

Fetch decrypted token from request context.

private getToken(): ?string

getRequest

Return request object.

private getRequest(): \Psr\Http\Message\ServerRequestInterface