public function editPermission(Request $request) { // prepare input $input = $request->all(); $operation = $request->get('operation'); $this->form_helper->prepareSentryPermissionInput($input, $operation); $id = $request->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('acl_messages.flash.error.user_permission_not_found')])); } return Redirect::route('users.edit', ["id" => $obj->id])->withMessage(Config::get('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]; }