CloudFlare\User::user PHP Method

user() public method

User details
public user ( )
    public function user()
    {
        return $this->get('user');
    }

Usage Example

Example #1
0
 /**
  * Retrieves the users' permisison levels
  */
 public function permissions()
 {
     if (!$this->permissions) {
         $api = new User($this->email, $this->auth_key);
         $user = $api->user();
         if (!$user->result->organizations[0]) {
             $this->permissions = array('read' => true, 'write' => true);
         } else {
             $this->permissions = $user->result->organizations[0]->permissions;
         }
     }
     return $this->permissions;
 }