Public Member Functions |
| | set ($route_id, $method, $granted, $overwrite=false) |
| | check ($route, $method) |
| | store () |
Static Public Member Functions |
| static | get ($consumer_id=null) |
Detailed Description
REST API routing permissions
- Author
- Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL 2 or later
- Since
- Stud.IP 3.0
Member Function Documentation
| check |
( |
|
$route, |
|
|
|
$method |
|
) |
| |
Checks if access to passed route via passed method is allowed for the current consumer.
- Parameters
-
| String | $route | Route template |
| String | $method | HTTP method |
- Returns
- bool Indicates whether access is allowed
| static get |
( |
|
$consumer_id = null | ) |
|
|
static |
Create a permission object (for a certain consumer). Permissions object will be cached for each consumer.
- Parameters
-
| mixed | $consumer_id | Id of consumer (optional, defaults to global) |
- Returns
- Permissions Returns permissions object
| loadPermissions |
( |
|
$consumer_id, |
|
|
|
$overwrite = false |
|
) |
| |
|
protected |
Loads permissions for passed consumer.
- Parameters
-
| String | $consumer_id | Id of the consumer in question |
| bool | $overwrite | May values be overwritten |
- Returns
- Permissions Returns instance of self to allow chaining
| set |
( |
|
$route_id, |
|
|
|
$method, |
|
|
|
$granted, |
|
|
|
$overwrite = false |
|
) |
| |
Defines whether access if allowed for the current consumer to the passed route via the passed method.
- Parameters
-
| String | $route_id | Route template (hash) |
| String | $method | HTTP method |
| mixed | $granted | Granted state (PHP'ish boolean) |
| bool | $overwrite | May values be overwritten |
- Returns
- bool Indicates if value could be changed.
Stores the set permissions.
- Returns
- bool Returns true if permissions were stored successfully
The documentation for this class was generated from the following file: