|
static | get ($consumer_id=null) |
|
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
Convenience method for activating all routes in a route map.
- Parameters
-
\RESTAPI\RouteMap | $routemap | RouteMap to activate |
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
deactivateRouteMap |
( |
RouteMap |
$routemap | ) |
|
Convenience method for deactivating all routes in a route map.
- Parameters
-
\RESTAPI\RouteMap | $routemap | RouteMap to activate |
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
- ConsumerPermissions 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
- ConsumerPermissions Returns instance of self to allow chaining
remove |
( |
|
$route_id, |
|
|
|
$method |
|
) |
| |
Removes stored permissions for a given route and method.
- Parameters
-
String | $route_id | Route template |
String | $method | HTTP method |
- Returns
- bool
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: