Re-enable debugbar, add table to ServersContainer.tsx

This commit is contained in:
Matthew Penner 2021-01-05 09:17:44 -07:00
parent ed73f6a020
commit 8f1a5bf0ab
15 changed files with 446 additions and 82 deletions

View file

@ -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);
}