PHPackages                             zfr/rbac - 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. zfr/rbac

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

zfr/rbac
========

Zend Framework 3 prototype for Zend\\Permissions\\Rbac.

2.0.0(10y ago)271.1M—3.9%14[1 issues](https://github.com/zf-fr/rbac/issues)7MITPHPPHP &gt;=5.5

Since Jan 13Pushed 3y ago5 watchersCompare

[ Source](https://github.com/zf-fr/rbac)[ Packagist](https://packagist.org/packages/zfr/rbac)[ Docs](https://github.com/zf-fr/rbac)[ RSS](/packages/zfr-rbac/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (2)Versions (5)Used By (7)

Rbac
====

[](#rbac)

[![Build Status](https://camo.githubusercontent.com/486fbace7c32703996fa42cec5081b8c4dc6388341430b2f84a2b4c65edb0a7b/68747470733a2f2f7472617669732d63692e6f72672f7a662d66722f726261632e706e67)](https://travis-ci.org/zf-fr/rbac)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/0dd846e7fcfe9f861f0f6a654b253f0247e0cda438d911de95675a803f1b9c15/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7a662d66722f726261632f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/zf-fr/rbac/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/33addc24a3480e1e0f417b10691079185b46c9f93e10967934ec8db155a89c0b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7a662d66722f726261632f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/zf-fr/rbac/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/613c12d449a8e2b9acfc27908315e1fa7232ab58825a27c8caaca9b5f0d13baf/68747470733a2f2f706f7365722e707567782e6f72672f7a66722f726261632f762f737461626c652e706e67)](https://packagist.org/packages/zfr/rbac)[![Total Downloads](https://camo.githubusercontent.com/4128d316b9ac9632142f26149603886c34e348126020d8ddf4908310098ac6ea/68747470733a2f2f706f7365722e707567782e6f72672f7a66722f726261632f646f776e6c6f6164732e706e67)](https://packagist.org/packages/zfr/rbac)

Rbac (not to be confused with ZfcRbac) is a pure PHP implementation of the RBAC (*Role based access control*) concept. Actually, it is a Zend Framework 3 prototype of the ZF2 Zend\\Permissions\\Rbac component.

It aims to fix some design mistakes that were made to make it more usable and more efficient.

It differs on those points:

- `RoleInterface` no longer have `setParent` and `getParent` methods, and cannot have children anymore (this is used to implement a simpler "flat RBAC").
- A new `HierarchicalRoleInterface` has been introduced to allow roles to have children.
- Method `hasPermission` on a role no longer recursively iterate the children role, but only check its own permissions. To properly check if a role is granted, you should use the `isGranted` method of the `Rbac` class.
- `Rbac` class is no longer a container. Instead, it just has a `isGranted` method. The container was complex to properly handle because of role duplication, which could lead to security problems if not used correctly.

Version 1.0 of this library is used in ZfcRbac 2.0. Version 2.0 of this library is used in ZfcRbac 3.0.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity49

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 71.6% 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 ~221 days

Total

4

Last Release

3844d ago

Major Versions

1.2.0 → 2.0.02015-11-08

PHP version history (2 changes)1.0.0PHP &gt;=5.4

2.0.0PHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e3c74232d02a5fedbcef4650bac1d1103be292d4a013f6f9e692befcc9bb7ca?d=identicon)[bakura10](/maintainers/bakura10)

---

Top Contributors

[![bakura10](https://avatars.githubusercontent.com/u/1198915?v=4)](https://github.com/bakura10 "bakura10 (48 commits)")[![danizord](https://avatars.githubusercontent.com/u/1850941?v=4)](https://github.com/danizord "danizord (11 commits)")[![jmleroux](https://avatars.githubusercontent.com/u/1516770?v=4)](https://github.com/jmleroux "jmleroux (7 commits)")[![Ocramius](https://avatars.githubusercontent.com/u/154256?v=4)](https://github.com/Ocramius "Ocramius (1 commits)")

---

Tags

securityrbaczf2zf3

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/zfr-rbac/health.svg)

```
[![Health](https://phpackages.com/badges/zfr-rbac/health.svg)](https://phpackages.com/packages/zfr-rbac)
```

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k89.8M1.0k](/packages/spatie-laravel-permission)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[owasp/phprbac

PHP-RBAC is the de-facto authorization library for PHP. It provides developers with NIST Level 2 Standard Role Based Access Control and more, in the fastest implementation yet.

435981.3k4](/packages/owasp-phprbac)[efficiently/authority-controller

AuthorityController is an PHP authorization library for Laravel 5 which restricts what resources a given user is allowed to access.

15533.2k](/packages/efficiently-authority-controller)[saeven/zf3-circlical-user

Complete user entity, rights, and access module for Laminas

3718.7k](/packages/saeven-zf3-circlical-user)[olivier127/rbac-bundle

Symfony PhpRabcBundle allow to use RBAC control access for symfony project

318.3k](/packages/olivier127-rbac-bundle)

PHPackages © 2026

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