mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-19 06:43:45 +02:00
Node and user API routes implemented.
More attempts at the logic for API permissions, most likely will need continued tweaking in the future, but base is there.
This commit is contained in:
@@ -79,7 +79,11 @@ class LocationTransformer extends TransformerAbstract
|
||||
*/
|
||||
public function includeServers(Location $location)
|
||||
{
|
||||
return $this->collection($location->servers, new ServerTransformer, 'server');
|
||||
if ($this->request && ! $this->request->apiKeyHasPermission('server-list')) {
|
||||
return;
|
||||
}
|
||||
|
||||
return $this->collection($location->servers, new ServerTransformer($this->request), 'server');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,6 +93,10 @@ class LocationTransformer extends TransformerAbstract
|
||||
*/
|
||||
public function includeNodes(Location $location)
|
||||
{
|
||||
return $this->collection($location->nodes, new NodeTransformer, 'node');
|
||||
if ($this->request && ! $this->request->apiKeyHasPermission('location-list')) {
|
||||
return;
|
||||
}
|
||||
|
||||
return $this->collection($location->nodes, new NodeTransformer($this->request), 'node');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user