public function editPermission()
 {
     // prepare input
     $input = Input::all();
     $operation = Input::get('operation');
     $this->form_helper->prepareSentryPermissionInput($input, $operation);
     $id = Input::get('id');
     try {
         $obj = $this->user_repository->update($id, $input);
     } catch (JacopoExceptionsInterface $e) {
         return Redirect::route("users.edit")->withInput()->withErrors(new MessageBag(["permissions" => "Permission not found"]));
     }
     return Redirect::action('Jacopo\\Authentication\\Controllers\\UserController@editUser', ["id" => $obj->id])->withMessage("Permission edited with success.");
 }
 public function editPermission()
 {
     // prepare input
     $input = Input::all();
     $operation = Input::get('operation');
     $this->form_helper->prepareSentryPermissionInput($input, $operation);
     $id = Input::get('id');
     try {
         $obj = $this->user_repository->update($id, $input);
     } catch (JacopoExceptionsInterface $e) {
         return Redirect::route("users.edit")->withInput()->withErrors(new MessageBag(["permissions" => Config::get('laravel-authentication-acl::messages.flash.error.user_permission_not_found')]));
     }
     return Redirect::action('Jacopo\\Authentication\\Controllers\\UserController@editUser', ["id" => $obj->id])->withMessage(Config::get('laravel-authentication-acl::messages.flash.success.user_permission_add_success'));
 }
 /**
  * @param $config
  * @return array
  */
 protected function createUser($config)
 {
     $user_repository = new SentryUserRepository($config);
     $input_user = ["email" => "*****@*****.**", "password" => "password", "activated" => 1];
     $user = $user_repository->create($input_user);
     return [$user_repository, $user];
 }