Simple dynamic access control list management.
- PHP 8.1 or higher
- Bootstrap
- composer
composer require drago-ex/authorization
extensions:
- Drago\Authorization\DI\AuthorizationExtension
use Drago\Authorization\Authorization
// Add redirect to sign in presenter or module
private string $loginLink = ':Module:Presenter:';
use Drago\Authorization\Control\AuthorizationControl
// Minimum configuration.
protected function createComponentPermissionsControl(): PermissionsControl
{
return $this->permissionsControl;
}
protected function createComponentRolesControl(): RolesControl
{
return $this->rolesControl;
}
protected function createComponentResourcesControl(): ResourcesControl
{
return $this->resourcesControl;
}
protected function createComponentPrivilegesControl(): PrivilegesControl
{
return $this->privilegesControl;
}
protected function createComponentAccessControl(): AccessControl
{
return $this->accessControl;
}
// Configure a custom template.
$control->templateControl = __DIR__ . '/path/to/file.latte';
$control->templateGrid = __DIR__ . '/path/to/file.latte';
// Inserting a translator.
$control->translator = $this->getTranslator();
{control permissionsControl}
{control rolesControl}
{control resourcesControl}
{control privilegesControl}
{control accessControl}