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 @license GPL 2 or later 
 
- Since
 - Stud.IP 2.6 
 
 
◆ check()
Checks if access to consumer is allowed for the current user.
- Parameters
 - 
  
    | String | $consumer_id | Id of the consumer  | 
  
   
- Returns
 - bool Indicates whether access is allowed 
 
 
 
◆ get()
  
  
      
        
          | static get  | 
          ( | 
            | 
          $user_id = null | ) | 
           | 
         
       
   | 
  
static   | 
  
 
Create a permission object (for a certain user). Permissions object will be cached for each user.
- Parameters
 - 
  
    | mixed | $user_id | Id of user (optional, defaults to global)  | 
  
   
- Returns
 - Permissions Returns permissions object 
 
 
 
◆ getConsumers()
Get a list of all consumer the user has granted acces to.
- Returns
 - Array List of consumer objects 
 
 
 
◆ loadPermissions()
Loads permissions for passed user.
- Returns
 - UserPermissions Returns instance of self to allow chaining 
 
 
 
◆ set()
      
        
          | set  | 
          ( | 
            | 
          $user_id,  | 
        
        
           | 
           | 
            | 
          $granted = true  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Defines whether access if allowed for the current user 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. 
 
 
 
◆ store()
Stores the set permissions.
- Returns
 - bool Returns true if permissions were stored successfully 
 
 
 
The documentation for this class was generated from the following file: