PHPackages                             drago-ex/project-permission - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. drago-ex/project-permission

ActiveDrago-tools-resource[Authentication &amp; Authorization](/categories/authentication)

drago-ex/project-permission
===========================

Component for managing user permissions in a Drago project.

v1.1.0(1mo ago)0159↓50%1MITPHPPHP &gt;=8.3 &lt;9CI passing

Since Jun 7Pushed 1mo agoCompare

[ Source](https://github.com/drago-ex/project-permission)[ Packagist](https://packagist.org/packages/drago-ex/project-permission)[ RSS](/packages/drago-ex-project-permission/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (7)Dependencies (16)Versions (10)Used By (1)

Drago Project Permission
========================

[](#drago-project-permission)

Component for ACL and permission management in a Drago / Nette project.

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://github.com/drago-ex/project-permission/blob/main/license)[![PHP version](https://camo.githubusercontent.com/d1fa62dc60f899cf36d067a167e24a8247b23d93989f7d0158533f666daa8160/68747470733a2f2f62616467652e667572792e696f2f70682f647261676f2d657825324670726f6a6563742d7065726d697373696f6e2e737667)](https://badge.fury.io/ph/drago-ex/project-permission)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Nette Framework
- Composer
- Bootstrap
- Naja
- Node.js
- Drago Project core packages

Installation
------------

[](#installation)

```
composer require drago-ex/project-permission
```

Project files
-------------

[](#project-files)

File copying is handled automatically by [drago-ex/project-tools](https://github.com/drago-ex/project-tools), which must be installed in your project. Without it, copy the files manually according to the `copy` section in this package's `composer.json`. To skip this package, set `"skip": true` under `extra.drago-tools.packages.` in your root `composer.json`.

After installation, run the package migrations, load the provided service configuration from `app/Presentation/Backend/Permission/conf.neon`, register the Naja extension from `assets/naja/permission-toggle.js`and include styles from `assets/naja/permission-toggle.scss`.

Example:

```
import naja from 'naja';
import PermissionToggle from './naja/permission-toggle.js';
import './naja/permission-toggle.scss';

naja.registerExtension(new PermissionToggle());
```

What it does
------------

[](#what-it-does)

- manages **roles**
- assigns **multiple roles to users**
- manages **resource + privilege** records
- allows role permissions to be toggled in the admin UI
- builds a Nette `Permission` ACL from registered providers and database data

The package ships with an admin section for:

- **Users** - assign roles to existing users
- **Roles** - create, edit and delete custom roles
- **Permissions** - allow or deny access for a selected role

The backend module is installed under `App\Presentation\Backend\Permission` and uses the `Backend:Permission`ACL resource. Module permissions are registered by `PermissionProvider` classes found in the presentation layer.

System roles such as `admin`, `user` and `guest` are handled as protected base roles.

Database
--------

[](#database)

The package works with these tables:

- `roles`
- `users_roles`
- `resources`
- `authorization`

Seed migrations also add default roles and backend permission resources.

Integration with project-auth
-----------------------------

[](#integration-with-project-auth)

To load roles from this package, implement the prepared `getRolesByUser()` method in [`UserRepository`](https://github.com/drago-ex/project-auth/blob/main/resources/app/Presentation/Sign/User/UserRepository.php):

```
public function getRolesByUser(int $userId): array
{
	$roles = $this->getConnection()
		->select('r.*')->from(RolesEntity::Table)->as('r')
		->innerJoin(UsersRolesEntity::Table)->as('ur')->on('ur.role_id = r.id')
		->where('ur.%n = ?', UsersRolesEntity::ColumnUserId, $userId)
		->fetchPairs(value: RolesEntity::ColumnName);

	$roles = array_values($roles);
	return $roles ?: [\Drago\Permission\Role::RoleUser];
}
```

Database migration
------------------

[](#database-migration)

```
php vendor/bin/migration db:migrate vendor/drago-ex/project-permission/migrations
```

Automated setup
---------------

[](#automated-setup)

This package exposes setup commands in `composer.json` under `extra.drago-tools.commands`. If [drago-ex/project-tools](https://github.com/drago-ex/project-tools) is installed, you can run them from the project root:

```
php vendor/bin/drago-setup
```

The migrations depend on the `users` table. Without `drago-setup`, run the `drago-ex/project-auth` migrations first.

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance91

Actively maintained with recent releases

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

9

Last Release

31d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5998929?v=4)[Zdeněk Papučík](/maintainers/accgit)[@accgit](https://github.com/accgit)

---

Top Contributors

[![accgit](https://avatars.githubusercontent.com/u/5998929?v=4)](https://github.com/accgit "accgit (132 commits)")

### Embed Badge

![Health badge](/badges/drago-ex-project-permission/health.svg)

```
[![Health](https://phpackages.com/badges/drago-ex-project-permission/health.svg)](https://phpackages.com/packages/drago-ex-project-permission)
```

###  Alternatives

[nette/web-project

Nette: Standard Web Project

10993.3k](/packages/nette-web-project)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
