HumHub Documentation (unofficial)

CheckAccessInterface

For more details and usage information on CheckAccessInterface, see the [guide article on security authorization](guide:security-authorization).

Tags
author

Sam Mousa sam@mousa.nl

since
2.0.9

Table of Contents

Methods

checkAccess()  : bool
Checks if the user has the specified permission.

Methods

checkAccess()

Checks if the user has the specified permission.

public checkAccess(string|int $userId, string $permissionName[, array<string|int, mixed> $params = [] ]) : bool
Parameters
$userId : string|int

the user ID. This should be either an integer or a string representing the unique identifier of a user. See [[\yii\web\User::id]].

$permissionName : string

the name of the permission to be checked against

$params : array<string|int, mixed> = []

name-value pairs that will be passed to the rules associated with the roles and permissions assigned to the user.

Tags
throws
InvalidParamException

if $permissionName does not refer to an existing permission

Return values
bool

whether the user has the specified permission.


        
On this page

Search results