Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drago-ex/authorization
:lock: Simple dynamic access control list management. (@nette)
https://github.com/drago-ex/authorization
acl nette
Last synced: about 2 months ago
JSON representation
:lock: Simple dynamic access control list management. (@nette)
- Host: GitHub
- URL: https://github.com/drago-ex/authorization
- Owner: drago-ex
- License: mit
- Created: 2020-03-31T06:14:20.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-24T06:05:21.000Z (12 months ago)
- Last Synced: 2024-04-25T02:39:23.446Z (9 months ago)
- Topics: acl, nette
- Language: PHP
- Homepage:
- Size: 676 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
## Drago Authorization
Simple dynamic access control list management.[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://raw.githubusercontent.com/drago-ex/authorization/master/license.md)
[![PHP version](https://badge.fury.io/ph/drago-ex%2Fauthorization.svg)](https://badge.fury.io/ph/drago-ex%2Fauthorization)
[![Tests](https://github.com/drago-ex/authorization/actions/workflows/tests.yml/badge.svg)](https://github.com/drago-ex/authorization/actions/workflows/tests.yml)
[![Coding Style](https://github.com/drago-ex/authorization/actions/workflows/coding-style.yml/badge.svg)](https://github.com/drago-ex/authorization/actions/workflows/coding-style.yml)
[![CodeFactor](https://www.codefactor.io/repository/github/drago-ex/authorization/badge)](https://www.codefactor.io/repository/github/drago-ex/authorization)
[![Coverage Status](https://coveralls.io/repos/github/drago-ex/authorization/badge.svg?branch=master)](https://coveralls.io/github/drago-ex/authorization?branch=master)## Technology
- PHP 8.1 or higher
- Bootstrap
- composer## Installation
```
composer require drago-ex/authorization
```## Extension registration
```neon
extensions:
- Drago\Authorization\DI\AuthorizationExtension
```## Use trait in base presenter for access control
```php
use Drago\Authorization\Authorization// Add redirect to sign in presenter or module
private string $loginLink = ':Module:Presenter:';
```## Use trait in presenter for settings access control
```php
use Drago\Authorization\Control\AuthorizationControl
```## Component creation and configuration
```php
// 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();
```## Use components in latte
```latte
{control permissionsControl}
{control rolesControl}
{control resourcesControl}
{control privilegesControl}
{control accessControl}
```