Arikaim CMS

UserAccess

UserAccess trait

Table of Contents

Methods

getUserId()  : int|null
Return current logged user id
hasAccess()  : bool
Return true if user have access permission
hasControlPanelAccess()  : bool
Return true if user have control panel access
requireAccess()  : void
Reguire permission check if current user have permission
requireControlPanelPermission()  : void
Require control panel permission
requireUser()  : void
Check logged user id
requireUserOrControlPanel()  : void
Check logged user id or contorl panel
user()  : mixed
Return current logged user

Methods

getUserId()

Return current logged user id

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

hasAccess()

Return true if user have access permission

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

For current user - null

Return values
bool

hasControlPanelAccess()

Return true if user have control panel access

public hasControlPanelAccess() : bool
Return values
bool

requireAccess()

Reguire permission check if current user have permission

public requireAccess(string $name[, mixed $type = null ][, string|int|null $authId = null ]) : void
Parameters
$name : string
$type : mixed = null
$authId : string|int|null = null

For current user - null

Tags
throws
HttpException

requireControlPanelPermission()

Require control panel permission

public requireControlPanelPermission() : void
Tags
throws
HttpException

requireUser()

Check logged user id

public requireUser(string|int $userId) : void
Parameters
$userId : string|int
Tags
throws
HttpException

requireUserOrControlPanel()

Check logged user id or contorl panel

public requireUserOrControlPanel(string|int $userId) : void
Parameters
$userId : string|int
Tags
throws
HttpException

user()

Return current logged user

public user() : mixed

        
On this page

Search results