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

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

inok/rbac
=========

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.

3.0.2(2y ago)024Apache-2.0PHPPHP &gt;=7.4.0

Since Mar 8Pushed 2y ago1 watchersCompare

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

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

PHP-RBAC v3.x
=============

[](#php-rbac-v3x)

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

**Current Stable Release:** [PHP-RBAC v3.0](https://github.com/nchizhov/inok-rbac)

Connect With Us
---------------

[](#connect-with-us)

- PHP-RBAC Base Home Page:
- PHP-RBAC Base Documentation: [http://phprbac.net/docs\_contents.php](http://phprbac.net/docs_contents.php)
- PHP-RBAC Base API:
- Issue Tracker:

What is a Rbac System?
----------------------

[](#what-is-a-rbac-system)

Take a look at the "[Before You Begin](http://phprbac.net/docs_before_you_begin.php)" section of our [Documentation](http://phprbac.net/docs_contents.php) to learn what an RBAC system is and what PHP-RBAC has to offer you and your project.

NIST Level 2 Compliance
-----------------------

[](#nist-level-2-compliance)

For information regarding NIST RBAC Levels, please see [This Paper](http://csrc.nist.gov/rbac/sandhu-ferraiolo-kuhn-00.pdf).

For more great resources see the [NIST RBAC Group Page](http://csrc.nist.gov/groups/SNS/rbac/).

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

[](#installation)

You can now use [Composer](https://getcomposer.org/) to install the PHP-RBAC code base.

For Installation Instructions please refer to the "[Getting Started](http://phprbac.net/docs_getting_started.php)" section of our [Documentation](http://phprbac.net/docs_contents.php).

Usage
-----

[](#usage)

**Instantiating a PHP-RBAC Object**

With a 'use' statement:

```
        use Inok\RBAC\Rbac;

        $rbac = new Rbac($db, $tablePrefix);
```

, where

- **$db** - PDO Object (supports MySQL, SQLite)
- **$tablePrefix** - RBAC-tables prefix (default: *phprbac*\_)

Tests
-----

[](#tests)

Xml-files for Unit Tests:

- phpunit.mysql.xml - For **MySQL** (**MariaDB**)
- phpunit.sqlite.xml - For **SQLite**

Fill correct data for database connection in needed phpunit xml file:

- **DB\_DSN** - Data source name
- **DB\_USER** - Database username
- **DB\_PASSWD** - Database password

Run:

```
    vendor/bin/phpunit -c xml_file_name
```

PHP-RBAC and PSR
----------------

[](#php-rbac-and-psr)

PHP-RBAC's Public API is now fully PSR-4 compliant.

You can now:

- Use Composer to install/update PHP-RBAC
- Use any PSR-4 compliant autoloader with PHP-RBAC
- Use the included autoloader to load PHP-RBAC

**If you notice any conflicts with PSR compliance please [Submit an Issue](https://github.com/nchizhov/inok-rbac/issues/new).**

### How You Can Help

[](#how-you-can-help)

- Report Bugs, Enhancement Requests or Documentation errors using our [Issue Tracker](https://github.com/nchizhov/inok-rbac/issues?state=open)
- [Choose a Bug](https://github.com/nchizhov/inok-rbac/issues?state=open) to work on and submit a Pull Request
- Make helpful suggestions and contributions to the [Documentation](http://phprbac.net/docs_contents.php) using our [Issue Tracker](https://github.com/nchizhov/inok-rbac/issues?state=open)

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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 ~4 days

Total

3

Last Release

791d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ce0f496c0c04c90c29675b08f834ad58707bc8e3498e1693e198e23e0b3e5871?d=identicon)[nchizhov](/maintainers/nchizhov)

---

Tags

securityrbac

###  Code Quality

TestsPHPUnit

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/inok-rbac/health.svg)](https://phpackages.com/packages/inok-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)[zfr/rbac

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

271.1M7](/packages/zfr-rbac)[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)[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)
