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:
@@ -83,7 +83,11 @@ class PackTransformer extends TransformerAbstract
|
||||
*/
|
||||
public function includeOption(Pack $pack)
|
||||
{
|
||||
return $this->item($pack->option, new OptionTransformer, 'option');
|
||||
if ($this->request && ! $this->request->apiKeyHasPermission('pack-view')) {
|
||||
return;
|
||||
}
|
||||
|
||||
return $this->item($pack->option, new OptionTransformer($this->request), 'option');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -93,6 +97,10 @@ class PackTransformer extends TransformerAbstract
|
||||
*/
|
||||
public function includeServers(Pack $pack)
|
||||
{
|
||||
return $this->collection($pack->servers, new ServerTransformer, 'server');
|
||||
if ($this->request && ! $this->request->apiKeyHasPermission('pack-view')) {
|
||||
return;
|
||||
}
|
||||
|
||||
return $this->collection($pack->servers, new ServerTransformer($this->request), 'server');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user