Add database password rotation to view
This commit is contained in:
parent
f6ee885f26
commit
48c39abfcb
11 changed files with 178 additions and 6 deletions
|
@ -6,6 +6,9 @@ use Pterodactyl\Models\Server;
|
|||
use Pterodactyl\Contracts\Http\ClientPermissionsRequest;
|
||||
use Pterodactyl\Http\Requests\Api\Application\ApplicationApiRequest;
|
||||
|
||||
/**
|
||||
* @method \Pterodactyl\Models\User user($guard = null)
|
||||
*/
|
||||
abstract class ClientApiRequest extends ApplicationApiRequest
|
||||
{
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Http\Requests\Api\Client\Servers\Databases;
|
||||
|
||||
use Pterodactyl\Models\Server;
|
||||
use Pterodactyl\Http\Requests\Api\Client\ClientApiRequest;
|
||||
|
||||
class RotatePasswordRequest extends ClientApiRequest
|
||||
{
|
||||
/**
|
||||
* Check that the user has permission to rotate the password.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return $this->user()->can('reset-db-password', $this->getModel(Server::class));
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue