/**
  * Get user permissions
  *
  * @return array
  */
 protected function getPermissions()
 {
     if ($this->isAuthenticated() === false) {
         return [];
     }
     if ($this->userPermissions === null) {
         // get user permissions
         $permissions = $this->permissionService->getUserPermissions($this->getUserId());
         foreach ($permissions as $p) {
             $this->userPermissions['route_names'][] = $p->route_name;
             $this->userPermissions['route_action_names'][] = $p->route_action_name;
         }
         if ($this->userPermissions === null) {
             return [];
         }
     }
     return $this->userPermissions;
 }
 public function savePermissions()
 {
     $permissions = \Input::get('permissions', []);
     $this->permissionService->savePermissions($permissions);
     return \Redirect::to(\URL::action('\\' . \Config::get('laravel-rbac.permissionController') . '@index'));
 }