Пример #1
0
 /**
  * is_client Returns true if the logged in user is in group `Client`
  * @return [boolean]
  */
 private function is_client()
 {
     try {
         // Find the Administrator group
         $client = Sentry::findGroupByName('Client');
         // Check if the user is in the client group
         if ($this->user->inGroup($client) || $this->user->isSuperUser()) {
             // User is in Client group
             return true;
         } else {
             // User is not in Client group
             return false;
         }
     } catch (Cartalyst\Sentry\Users\UserNotFoundException $e) {
         // echo 'User was not found.';
         return false;
     } catch (Cartalyst\Sentry\Groups\GroupNotFoundException $e) {
         // echo 'Group was not found.';
         return false;
     }
 }