Re-enable debugbar, add table to ServersContainer.tsx
This commit is contained in:
parent
ed73f6a020
commit
8f1a5bf0ab
15 changed files with 446 additions and 82 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue