PHP code example of drago-ex / authorization

1. Go to this page and download the library: Download drago-ex/authorization library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

drago-ex / authorization example snippets


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();