AccessFilter
Filter for getting items according to user rights.
Table of Contents
Methods
- __construct() : mixed
- getFilter() : array<string|int, mixed>
- Filter for getting elements.
Methods
__construct()
public
__construct(AccessibleController $controller) : mixed
Parameters
- $controller : AccessibleController
getFilter()
Filter for getting elements.
public
getFilter(string $entity[, array<string|int, mixed> $params = [] ]) : array<string|int, mixed>
One instance of access filter can handle multiple entities (recommended to use 1 filter for entities that
are similar in meaning and purpose). To get a filter for a specific entity, you need to pass the entity
parameter.
If the user has full access, then you can return an empty array (i.e. there is no filtering). If the user does not have access at all, then you can return a deliberately false filter that will not return records (for example, `ID IS NULL').
Parameters
- $entity : string
- $params : array<string|int, mixed> = []