Allow creating subuser with no permissions
This commit is contained in:
parent
96699b192e
commit
304d947536
5 changed files with 7 additions and 5 deletions
|
@ -17,6 +17,7 @@ This project follows [Semantic Versioning](http://semver.org) guidelines.
|
||||||
### Changed
|
### Changed
|
||||||
* Attempting to upload a folder via the web file manager will now display a warning telling the user to use SFTP.
|
* Attempting to upload a folder via the web file manager will now display a warning telling the user to use SFTP.
|
||||||
* Changing your account password will now log out all other sessions that currently exist for that user.
|
* Changing your account password will now log out all other sessions that currently exist for that user.
|
||||||
|
* Subusers with no permissions selected can be created.
|
||||||
|
|
||||||
## v0.7.7 (Derelict Dermodactylus)
|
## v0.7.7 (Derelict Dermodactylus)
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -157,7 +157,6 @@ class SubuserController extends Controller
|
||||||
* @return \Illuminate\Http\RedirectResponse
|
* @return \Illuminate\Http\RedirectResponse
|
||||||
*
|
*
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
* @throws \Illuminate\Auth\Access\AuthorizationException
|
|
||||||
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
* @throws \Pterodactyl\Exceptions\Model\DataValidationException
|
||||||
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
* @throws \Pterodactyl\Exceptions\Repository\RecordNotFoundException
|
||||||
* @throws \Pterodactyl\Exceptions\Service\Subuser\ServerSubuserExistsException
|
* @throws \Pterodactyl\Exceptions\Service\Subuser\ServerSubuserExistsException
|
||||||
|
@ -171,7 +170,7 @@ class SubuserController extends Controller
|
||||||
$this->alert->success(trans('server.users.user_assigned'))->flash();
|
$this->alert->success(trans('server.users.user_assigned'))->flash();
|
||||||
|
|
||||||
return redirect()->route('server.subusers.view', [
|
return redirect()->route('server.subusers.view', [
|
||||||
'uuid' => $server->uuid,
|
'uuid' => $server->uuidShort,
|
||||||
'id' => $subuser->hashid,
|
'id' => $subuser->hashid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ class SubuserStoreFormRequest extends ServerFormRequest
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'permissions' => 'present|array',
|
'permissions' => 'sometimes|array',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,6 +56,8 @@ class PermissionCreationService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->repository->withoutFreshModel()->insert($insertPermissions);
|
if (! empty($insertPermissions)) {
|
||||||
|
$this->repository->withoutFreshModel()->insert($insertPermissions);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -182,7 +182,7 @@ class SubuserControllerTest extends ControllerTestCase
|
||||||
$response = $controller->store($this->request);
|
$response = $controller->store($this->request);
|
||||||
$this->assertIsRedirectResponse($response);
|
$this->assertIsRedirectResponse($response);
|
||||||
$this->assertRedirectRouteEquals('server.subusers.view', $response, [
|
$this->assertRedirectRouteEquals('server.subusers.view', $response, [
|
||||||
'uuid' => $server->uuid,
|
'uuid' => $server->uuidShort,
|
||||||
'id' => $subuser->hashid,
|
'id' => $subuser->hashid,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue