Skip to content

GUIDE User Permissions

Andy Rixon edited this page Jan 9, 2018 · 1 revision

Permissions are used to prevent or allow features to be access by any usergroup throughout the forum. Including the ACP.

Usage

Check

Checks if the user has a certain permission in their usergroup.

$LAYER->perm->check('permission_name' = string)

Returns true if user has permission and false if user does not have the permission.

Creating Permission

$LAYER->perm->create('permission_name' = string)

It will return false if there is any error, and true if permission is created successfully.

Checking Permission with ID

$LAYER->perm->perm('permission_id' = int)

It will return an array if the permission id is valid. False if otherwise.

Give additional permission to a user.

$LAYER->user->givePermission('user_id' = int, 'permission_name' = string)

It will return false if the user id or permission name is invalid. True if functions correctly.

Remove additional permission from a user.

$LAYER->user->removeAddPermission('user_id' = int, 'permission_name' = string)

It will return false of user id or permission name is invalid. True if functions correctly.