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

ActiveLibrary

createloop/php-rbac
===================

rbac

1.1.1(11y ago)2211MITPHPPHP &gt;=5.4.0

Since Sep 19Pushed 9y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (6)Used By (0)

php-rbac
========

[](#php-rbac)

Installation：
-------------

[](#installation)

```
{
    "require": {
        "createloop/php-rbac": "1.1.*@dev"
    }
}
```

Defautl Usage：
--------------

[](#defautl-usage)

1. 把DB資料夾裡的sql 部屬在database （預設載體為Mysql，以PDO實現，要用不同儲存方式請看 *Custom Usage*）
2. 調整Storage/config.php 裡面的連線參數設定 或是 new MysqlStorage 帶入連線必要參數

Custom Usage：
-------------

[](#custom-usage)

1. 可選擇自行實現儲存載體，只要繼承RBAC\\Interfaces\\IStroage ，實作裡面的方法即可。

Usage:
------

[](#usage)

驗證：

```
$rbac = new Rbac("user_id",new ProxyFactory(IStorage storage), IStorage storage);
$rbac->auth("controller/action/resource","get"); //return true or false
```

建構新 resource：

```
$admin = new admin(new ProxyFactory(IStorage $storage), IStorage $storage);
$resource = $admin->createResource($name, $resource);
```

建構新 Role：

```
$admin = new admin(new ProxyFactory(IStorage $storage), IStorage $storage);
$role = $resource = $admin->createRole($name);
```

賦予Role Resource：

```
$role->addResource($resource);
```

License
-------

[](#license)

Composer is licensed under the MIT License - see the LICENSE file for details

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

5

Last Release

4252d ago

### Community

Maintainers

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

---

Top Contributors

[![syhlion](https://avatars.githubusercontent.com/u/8326955?v=4)](https://github.com/syhlion "syhlion (67 commits)")

### Embed Badge

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

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

PHPackages © 2026

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