{"id":20381259,"url":"https://github.com/drago-ex/authorization","last_synced_at":"2026-05-10T00:49:41.328Z","repository":{"id":46557705,"uuid":"251516316","full_name":"drago-ex/authorization","owner":"drago-ex","description":":lock: Simple dynamic access control list management. (@nette)","archived":false,"fork":false,"pushed_at":"2024-01-24T06:05:21.000Z","size":692,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-25T02:39:23.446Z","etag":null,"topics":["acl","nette"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drago-ex.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-31T06:14:20.000Z","updated_at":"2024-06-18T05:49:38.324Z","dependencies_parsed_at":"2024-06-18T05:59:29.490Z","dependency_job_id":null,"html_url":"https://github.com/drago-ex/authorization","commit_stats":{"total_commits":447,"total_committers":2,"mean_commits":223.5,"dds":0.008948545861297563,"last_synced_commit":"8a81ecf8e7931b805e4dcb9442ec8c550d996f41"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drago-ex%2Fauthorization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drago-ex%2Fauthorization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drago-ex%2Fauthorization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drago-ex%2Fauthorization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drago-ex","download_url":"https://codeload.github.com/drago-ex/authorization/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241933167,"owners_count":20044658,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acl","nette"],"created_at":"2024-11-15T02:12:43.047Z","updated_at":"2026-05-10T00:49:41.322Z","avatar_url":"https://github.com/drago-ex.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Drago Authorization\nDrago Authorization is a simple and dynamic access control list (ACL) management system built on top of the Nette Framework.\nIt provides an easy-to-use solution for managing roles, resources, and permissions, with built-in support for PHP 8.3 or higher.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://raw.githubusercontent.com/drago-ex/authorization/master/license)\n[![PHP version](https://badge.fury.io/ph/drago-ex%2Fauthorization.svg)](https://badge.fury.io/ph/drago-ex%2Fauthorization)\n[![Tests](https://github.com/drago-ex/authorization/actions/workflows/tests.yml/badge.svg)](https://github.com/drago-ex/authorization/actions/workflows/tests.yml)\n[![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)\n[![CodeFactor](https://www.codefactor.io/repository/github/drago-ex/authorization/badge)](https://www.codefactor.io/repository/github/drago-ex/authorization)\n[![Coverage Status](https://coveralls.io/repos/github/drago-ex/authorization/badge.svg?branch=master)](https://coveralls.io/github/drago-ex/authorization?branch=master)\n\n## Requirements\n- PHP \u003e= 8.3\n- Nette Framework\n- Composer\n- Bootstrap\n\n## Installation\n```\ncomposer require drago-ex/authorization\n```\n\n## Extension Registration\nTo use Drago Authorization in your Nette application, register the extension in your `config.neon` file:\n```neon\nextensions:\n\t- Drago\\Authorization\\DI\\AuthorizationExtension\n```\n\n# Usage\n## Use Trait in Base Presenter for Access Control\nYou can use the `Authorization` trait in your base presenter to manage access control and redirect users to the login page if needed.\n\n```php\nuse Drago\\Authorization\\Authorization\n\n// Redirect to a specific login presenter or module\nprivate string $loginLink = ':Module:Presenter:';\n```\n\n## UUse Trait in Presenter for Access Control Settings\nIn each presenter, use the `AuthorizationControl` trait to manage authorization control.\n```php\nuse Drago\\Authorization\\Control\\AuthorizationControl\n```\n\n## Component Creation and Configuration\nHere’s how to create and configure the main components for managing roles, permissions, and resources:\n```php\n// Minimum configuration to create components.\n\nprotected function createComponentPermissionsControl(): PermissionsControl\n{\n\treturn $this-\u003epermissionsControl;\n}\n\nprotected function createComponentRolesControl(): RolesControl\n{\n\treturn $this-\u003erolesControl;\n}\n\nprotected function createComponentResourcesControl(): ResourcesControl\n{\n\treturn $this-\u003eresourcesControl;\n}\n\nprotected function createComponentPrivilegesControl(): PrivilegesControl\n{\n\treturn $this-\u003eprivilegesControl;\n}\n\nprotected function createComponentAccessControl(): AccessControl\n{\n\treturn $this-\u003eaccessControl;\n}\n```\n\nYou can also configure custom templates for the components:\n```php\n// Set custom templates for controls\n$control-\u003etemplateControl = __DIR__ . '/path/to/file.latte';\n$control-\u003etemplateGrid = __DIR__ . '/path/to/file.latte';\n\n// Insert a translator for multi-language support\n$control-\u003etranslator = $this-\u003egetTranslator();\n```\n\n## Use Components in Latte\nOnce the components are configured, you can render them in your Latte templates:\n```latte\n{control permissionsControl}\n{control rolesControl}\n{control resourcesControl}\n{control privilegesControl}\n{control accessControl}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrago-ex%2Fauthorization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrago-ex%2Fauthorization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrago-ex%2Fauthorization/lists"}