PHPackages                             leighmacdonald/php\_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. [Database &amp; ORM](/categories/database)
4. /
5. leighmacdonald/php\_rbac

ActiveLibrary[Database &amp; ORM](/categories/database)

leighmacdonald/php\_rbac
========================

An implementation of RBAC Level 2

1.0.2(12y ago)262702[3 issues](https://github.com/leighmacdonald/php_rbac/issues)MITPHPPHP &gt;=5.4.0

Since Apr 29Pushed 12y ago3 watchersCompare

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

READMEChangelog (2)Dependencies (3)Versions (6)Used By (0)

php\_rbac - RBAC Level 1 Implementation
=======================================

[](#php_rbac---rbac-level-1-implementation)

[![Build Status](https://camo.githubusercontent.com/63c393243ac636a25317e9a704353128895d298b780cae267eca10f865766999/68747470733a2f2f7472617669732d63692e6f72672f6c656967686d6163646f6e616c642f7068705f726261632e706e67)](https://travis-ci.org/leighmacdonald/php_rbac)

This library aims to provide a modern PHP based RBAC (Role-Based Access Control) implementation.

For more information about RBAC please see the following links:

- [The NIST Model for Role-Based Access Control (pdf)](http://csrc.nist.gov/rbac/sandhu-ferraiolo-kuhn-00.pdf)
- [Role-based access control (wikipedia)](http://en.wikipedia.org/wiki/Role-based_access_control)

Installation / Usage
--------------------

[](#installation--usage)

1. Setup your composer.json file with the following declaration.

    ```
    {
        "require": {
            "leighmacdonald/php_rbac": "dev-master"
        }
    }
    ```
2. If you are just using the lib: `composer update`. If you are developing against the lib: `composer update --dev`
3. Check out the [docs](https://github.com/leighmacdonald/php_rbac/tree/master/docs) folder for usage examples and other information.

TODO
----

[](#todo)

- NIST Level 2, Currently only level 1 is implemented.
- Cached implementation using:
    - Memcache
    - APC

Contributing
------------

[](#contributing)

If you wish to contribute, please make sure the following criteria are met:

1. Your code conforms to PSR specifications.
2. All code additions should include test cases. (if applicable).
3. The test suite passes.

PHPUnit Tests
-------------

[](#phpunit-tests)

There is a example phpunit config file that should be edited before running. Notably you should change the default database parameters.

1. Install the composer dev dependencies: `composer update --dev`
2. Run phpunit: `./vendor/bin/phpunit`

Authors
-------

[](#authors)

Leigh MacDonald -  -

License
-------

[](#license)

php\_rbac is licensed under the MIT License - see the [`LICENSE`](https://github.com/leighmacdonald/php_rbac/blob/master/LICENSE).

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 96.7% 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 ~67 days

Total

4

Last Release

4543d ago

Major Versions

0.9.0 → 1.0.02013-07-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b113aa2cfbf5a5a824353540f76a4e6cc59db27039bcbca6f14c4221e0aa764?d=identicon)[leighmacdonald](/maintainers/leighmacdonald)

---

Top Contributors

[![toor-totv](https://avatars.githubusercontent.com/u/12632162?v=4)](https://github.com/toor-totv "toor-totv (59 commits)")[![leighmacdonald](https://avatars.githubusercontent.com/u/591973?v=4)](https://github.com/leighmacdonald "leighmacdonald (2 commits)")

---

Tags

databaseauthAuthenticationrbac

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[kitar/laravel-dynamodb

A DynamoDB based Eloquent model and Query builder for Laravel.

193675.3k1](/packages/kitar-laravel-dynamodb)[cycle/database

DBAL, schema introspection, migration and pagination

64690.9k31](/packages/cycle-database)[tommyknocker/pdo-database-class

Framework-agnostic PHP database library with unified API for MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, and Oracle. Query Builder, caching, sharding, window functions, CTEs, JSON, migrations, ActiveRecord, CLI tools, AI-powered analysis. Zero external dependencies.

845.7k](/packages/tommyknocker-pdo-database-class)[casbin/dbal-adapter

Database Abstraction Layer adapter for php-casbin.

1494.7k1](/packages/casbin-dbal-adapter)[bartlett/php-compatinfo-db

Reference Database of all functions, constants, classes, interfaces on PHP standard distribution and about 110 extensions

1183.0k1](/packages/bartlett-php-compatinfo-db)

PHPackages © 2026

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