Add proper permissions for role application routes, allow admins to access application api

This commit is contained in:
Matthew Penner 2020-12-28 12:47:08 -07:00
parent b6abeb0994
commit 9c7b49e2b9
16 changed files with 287 additions and 112 deletions

View 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;
}
}