Documentation

UserPermsInterface extends ServiceInterface

Provides user permission functions for the front-end

Table of Contents

Methods

checkPermissionsTree()  : bool
Checks whether the currently logged in user can access the specified item.
configure()  : void
Configure the service.
getAccessableGroups()  : array<string|int, mixed>
Returns a list of groups which can access a specific page.
getAccessDenied()  : BaseView|null
Return a message which is output to a user when access is denied
getAllCategories()  : array<string|int, mixed>
Gets a list of all of the user categories

Methods

checkPermissionsTree()

Checks whether the currently logged in user can access the specified item.

public static checkPermissionsTree(string $table, int $id) : bool

This method should be used for tree-based tables, like the 'pages' table, which may inherit their permissions from the parent record.

Parameters
$table : string

The table name of the item to check

$id : int

The id of the record to check

Return values
bool —

True if the user has access, false otherwise

configure()

Configure the service.

public static configure(array<string|int, mixed> $config) : void
Parameters
$config : array<string|int, mixed>

getAccessableGroups()

Returns a list of groups which can access a specific page.

public static getAccessableGroups(string $table, int $id) : array<string|int, mixed>
Parameters
$table : string

The table to get permissions for

$id : int

The ID of the record to get permissions for

Return values
array<string|int, mixed> —

Each element is a category id

getAllCategories()

Gets a list of all of the user categories

public static getAllCategories() : array<string|int, mixed>
Return values
array<string|int, mixed> —

[id => name]

On this page

Search results