Stud.IP  3.1 Revision 48552
 All Data Structures Namespaces Files Functions Variables Groups Pages
ConsumerPermissions Class Reference
Collaboration diagram for ConsumerPermissions:
Collaboration graph

Public Member Functions

 set ($route_id, $method, $granted, $overwrite=false)
 check ($route, $method)
 store ()

Static Public Member Functions

static get ($consumer_id=null)

Protected Member Functions

 loadPermissions ($consumer_id, $overwrite=false)

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$routeRoute template
String$methodHTTP 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_idId 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_idId of the consumer in question
bool$overwriteMay values be overwritten
Returns
Permissions Returns instance of self to allow chaining

Here is the call graph for this function:

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_idRoute template (hash)
String$methodHTTP method
mixed$grantedGranted state (PHP'ish boolean)
bool$overwriteMay values be overwritten
Returns
bool Indicates if value could be changed.
store ( )

Stores the set permissions.

Returns
bool Returns true if permissions were stored successfully

Here is the call graph for this function:


The documentation for this class was generated from the following file: