Update all of the permissions checking to be constant based
This commit is contained in:
parent
605c154812
commit
23d594f655
18 changed files with 98 additions and 40 deletions
|
@ -2,18 +2,18 @@
|
|||
|
||||
namespace Pterodactyl\Http\Requests\Api\Client\Servers;
|
||||
|
||||
use Pterodactyl\Models\Server;
|
||||
use Pterodactyl\Models\Permission;
|
||||
|
||||
class SendCommandRequest extends GetServerRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the API user has permission to perform this action.
|
||||
*
|
||||
* @return bool
|
||||
* @return string
|
||||
*/
|
||||
public function authorize(): bool
|
||||
public function permission(): string
|
||||
{
|
||||
return $this->user()->can('control.console', $this->getModel(Server::class));
|
||||
return Permission::ACTION_CONTROL_CONSOLE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue