mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-20 15:23:44 +02:00
Re-enable debugbar, add table to ServersContainer.tsx
This commit is contained in:
@@ -22,6 +22,11 @@ abstract class BaseTransformer extends TransformerAbstract
|
||||
*/
|
||||
private $key;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $rootAdmin;
|
||||
|
||||
/**
|
||||
* Return the resource name for the JSONAPI output.
|
||||
*
|
||||
@@ -64,6 +69,30 @@ abstract class BaseTransformer extends TransformerAbstract
|
||||
return $this->key;
|
||||
}
|
||||
|
||||
/**
|
||||
* ?
|
||||
*
|
||||
* @param bool $rootAdmin
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function setRootAdmin(bool $rootAdmin)
|
||||
{
|
||||
$this->rootAdmin = $rootAdmin;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* ?
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function isRootAdmin(): bool
|
||||
{
|
||||
return $this->rootAdmin;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the API key loaded onto the transformer has permission
|
||||
* to access a different resource. This is used when including other
|
||||
@@ -75,6 +104,10 @@ abstract class BaseTransformer extends TransformerAbstract
|
||||
*/
|
||||
protected function authorize(string $resource): bool
|
||||
{
|
||||
if ($this->isRootAdmin()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return AdminAcl::check($this->getKey(), $resource, AdminAcl::READ);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user