Add proper permissions for role application routes, allow admins to access application api
This commit is contained in:
parent
b6abeb0994
commit
9c7b49e2b9
16 changed files with 287 additions and 112 deletions
20
app/Http/Requests/Api/Application/Roles/GetRoleRequest.php
Normal file
20
app/Http/Requests/Api/Application/Roles/GetRoleRequest.php
Normal file
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Http\Requests\Api\Application\Roles;
|
||||
|
||||
use Pterodactyl\Models\AdminRole;
|
||||
|
||||
class GetRoleRequest extends GetRolesRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the requested role exists on the Panel.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function resourceExists(): bool
|
||||
{
|
||||
$role = $this->route()->parameter('role');
|
||||
|
||||
return $role instanceof AdminRole && $role->exists;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue