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
33
app/Transformers/Api/Application/AdminRoleTransformer.php
Normal file
33
app/Transformers/Api/Application/AdminRoleTransformer.php
Normal file
|
@ -0,0 +1,33 @@
|
|||
<?php
|
||||
|
||||
namespace Pterodactyl\Transformers\Api\Application;
|
||||
|
||||
use Pterodactyl\Models\AdminRole;
|
||||
|
||||
class AdminRoleTransformer extends BaseTransformer
|
||||
{
|
||||
/**
|
||||
* Return the resource name for the JSONAPI output.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getResourceName(): string
|
||||
{
|
||||
return AdminRole::RESOURCE_NAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a transformed User model that can be consumed by external services.
|
||||
*
|
||||
* @param \Pterodactyl\Models\AdminRole $role
|
||||
* @return array
|
||||
*/
|
||||
public function transform(AdminRole $role): array
|
||||
{
|
||||
return [
|
||||
'id' => $role->id,
|
||||
'name' => $role->name,
|
||||
'description' => $role->description,
|
||||
];
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue