Arikaim CMS

AuthInterface extends AccessInterface

Auth interface

Table of Contents

Constants

CONTROL_PANEL  = 'ControlPanel'
Control panel permission
DELETE  = ['delete']
EXECUTE  = ['execute']
FULL  = ['read', 'write', 'delete', 'execute']
Full permissions
READ  = ['read']
Read
WRITE  = ['write']

Methods

addPermission()  : bool
Add permission item.
authenticate()  : bool
Authenticate user
getControlPanelPermission()  : string
Control panel permission name
getFullPermissions()  : array<string|int, mixed>
Full Permissions
getId()  : int|null
Get current auth id
getLoginAttempts()  : int|null
Get login attempts
getProvider()  : AuthProviderInterface
Return auth provider
getUser()  : array<string|int, mixed>|null
Get current auth user
getUserPermissions()  : mixed
Get user permissions list
hasAccess()  : bool
Check access
hasControlPanelAccess()  : bool
Check if current loged user have control panel access
isLogged()  : bool
Return true if user is logged
logout()  : void
Logout
middleware()  : object|null
Create auth middleware
resolveAuthType()  : null|int
Get auth name
resolvePermissionName()  : array<string|int, mixed>
Resolve permission full name name:type
withProvider()  : AuthProviderInterface
Change auth provider

Constants

CONTROL_PANEL

Control panel permission

public mixed CONTROL_PANEL = 'ControlPanel'

FULL

Full permissions

public mixed FULL = ['read', 'write', 'delete', 'execute']

Methods

addPermission()

Add permission item.

public addPermission(string $name[, string|null $title = null ][, string|null $description = null ][, string|null $extension = null ]) : bool
Parameters
$name : string
$title : string|null = null
$description : string|null = null
$extension : string|null = null
Return values
bool

authenticate()

Authenticate user

public authenticate(array<string|int, mixed> $credentials) : bool
Parameters
$credentials : array<string|int, mixed>
Return values
bool

getControlPanelPermission()

Control panel permission name

public getControlPanelPermission() : string
Return values
string

getFullPermissions()

Full Permissions

public getFullPermissions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getId()

Get current auth id

public getId() : int|null
Return values
int|null

getLoginAttempts()

Get login attempts

public getLoginAttempts() : int|null
Return values
int|null

getProvider()

Return auth provider

public getProvider() : AuthProviderInterface
Return values
AuthProviderInterface

getUser()

Get current auth user

public getUser() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

getUserPermissions()

Get user permissions list

public getUserPermissions([int|null $authId = null ]) : mixed
Parameters
$authId : int|null = null

hasAccess()

Check access

public hasAccess(string|int $name[, string|array<string|int, mixed>|null $type = null ][, int|null $authId = null ]) : bool
Parameters
$name : string|int

Permission name

$type : string|array<string|int, mixed>|null = null

PermissionType (read,write,execute,delete)

$authId : int|null = null
Return values
bool

hasControlPanelAccess()

Check if current loged user have control panel access

public hasControlPanelAccess([int|null $authId = null ]) : bool
Parameters
$authId : int|null = null
Return values
bool

isLogged()

Return true if user is logged

public isLogged() : bool
Return values
bool

middleware()

Create auth middleware

public middleware(string $authName[, array<string|int, mixed> $args = null ]) : object|null
Parameters
$authName : string
$args : array<string|int, mixed> = null
Return values
object|null

resolveAuthType()

Get auth name

public resolveAuthType(string|int $type) : null|int
Parameters
$type : string|int
Return values
null|int

resolvePermissionName()

Resolve permission full name name:type

public resolvePermissionName(string $name) : array<string|int, mixed>
Parameters
$name : string
Return values
array<string|int, mixed>

withProvider()

Change auth provider

public withProvider(AuthProviderInterface|string $provider[, UserProviderInterface|null $user = null ][, array<string|int, mixed> $params = [] ]) : AuthProviderInterface
Parameters
$provider : AuthProviderInterface|string
$user : UserProviderInterface|null = null
$params : array<string|int, mixed> = []
Return values
AuthProviderInterface

        
On this page

Search results