Search by

pushinbr / nimbus-permission

DavidWilliamBalbino

Roles and permissions with optional teams, Gate integration and route middleware for Nimbus.

v0.8.0 2026-12-02 21:25 UTC

This package is auto-updated.

Last update: 2026-12-02 21:41:58 UTC


README

Roles and permissions with optional teams, Gate integration and route middleware for Nimbus.

Roles carry permissions; a subject (the principal identifier, user:42) gets roles and direct permissions, globally or inside a team. A Gate before() hook lets a permission authorize the ability of the same name, role:/permission: route middleware check them, and the reads are cached per request and, with a shared cache repository, across workers.

Start here

Install PAM first (curl -fsSL https://push-in.github.io/pam/install.sh | sh), then add the package to a Nimbus application (Nimbus 0.8.1 or later):

pam composer require pushinbr/nimbus-permission
$permissions->createRole('editor', permissions: ['posts.edit']);
$permissions->assignRole('user:42', 'editor');
$app->post('/posts', PostController::class)->auth()->middleware('permission:posts.edit');

Documentation: docs/nimbus/permissoes.md.

Evaluated packages

Checked on Packagist (search rbac, acl, role permission) on 2026-12-02 before writing the package (downloads: total / last month).

None of the framework-agnostic libraries stores roles per subject or per team: they evaluate an in-memory graph the application builds. What this package implements is that storage over Arcano, its per-request and shared cache, and the Gate and middleware integration; the evaluation itself is a set lookup.

Package Downloads License Latest Decision
casbin/casbin 1.75M / 62k Apache-2.0 4.6.2 (2026-11-16) Not used. Its RBAC-with-domains model covers roles per team, but the enforcer loads the whole policy into memory and needs a storage adapter plus a watcher to invalidate other workers; here each check reads only the subject's rows (indexed) and caches them per request, and it adds symfony/cache and symfony/expression-language.
laminas/laminas-permissions-rbac 4.2M / 171k BSD-3-Clause 3.9.0 (2026-11-15) Not used. An in-memory role graph with no storage, subjects or teams; with flat roles its check is the set lookup the package already does, so it would add a dependency without behaviour. Worth revisiting if role inheritance is added.
laminas/laminas-permissions-acl 16.8M / 847k BSD-3-Clause 2.19.0 (2026-11-15) Not used. Resource/privilege ACL, also in memory and without storage; a different model from roles and permissions per subject.
nette/security 10.6M BSD-3-Clause or GPL 3.2.8 (2026-11-18) Not used. Nette\Security\Permission is an in-memory ACL (roles, resources, privileges) bundled with Nette's authenticator and identity; no storage, subjects or teams.
spiral/security 7.1M MIT 3.19.0 (2026-11-30) Not used. In-memory permission manager and rules tied to Spiral's actor/guard model; no storage or teams.
symfony/security-acl 41.7M MIT 3.5.0 (2026-10-29) Not used. Per-object ACL entries stored through Doctrine DBAL and Symfony Security; a different model and stack.
silber/bouncer, santigarcor/laratrust 5.5M, 6.8M MIT — Not usable: Eloquent-based.
spatie/laravel-permission 141M / 10.9M MIT 8.5.2 (2026-11-30) Not usable: requires illuminate/database, illuminate/auth and the Laravel container. Its table layout, team support and API names are the reference for this package.

Development

The package is developed in the push-in/pam monorepo (packages/nimbus-permission); push-in/nimbus-permission is a read-only split. Its tests share the runtime stubs and fixtures of packages/nimbus/tests:

scripts/nimbus-package-test.sh nimbus-permission

License

Apache-2.0. See LICENSE.