PHPackages                             niceforbear/jdbrbac - 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. niceforbear/jdbrbac

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

niceforbear/jdbrbac
===================

RBAC Module

v1.0.3(10y ago)020MITPHPPHP &gt;=5.6.0

Since Jun 12Pushed 5y ago1 watchersCompare

[ Source](https://github.com/niceforbear/jdbrbac)[ Packagist](https://packagist.org/packages/niceforbear/jdbrbac)[ Docs](https://github.com/niceforbear)[ RSS](/packages/niceforbear-jdbrbac/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (5)Used By (0)

Usage
=====

[](#usage)

1. 在config的`web.php`中, 添加配置:

'modules' =&gt; \[ 'jdbrbac' =&gt; \[ 'class' =&gt; 'app\\jdbrbac\\JdbRbac', \], \]

2. 配置`jdbrbac/components/Utils.php`文件下的常量: `ENVIRONMENT`, 可填写的值为`dev` or `prod`.
3. 配置`jdbrbac/components/Utils.php`文件下的`$config`, 配置`source_data`.

- dir: 要初始化`路由(系统的资源节点)`的目录
- namespace: 每一个目录的命名空间
- prefix: 如果是module, 则需要填写自定义的命名空间prefix, 默认为空

4. 将views目录下的`jdbrbac`目录拷贝到项目目录的views文件夹下的某个controller文件夹下, 同时在该controller文件中按照Yii的方式配置请求入口.
5. 使用

- 初始化系统路由
- 添加自定义路由
- 基于路由创建权限
- 基于权限创建角色
- 给用户分配角色
- 使用`JdbRbac::isAllowed($userId)`来检查用户是否可以访问当前路由.

6. 演示

> 线上Demo参考：

有关界面
====

[](#有关界面)

1. 路由管理

- 更新(Add)项目全局路由
- 获得全部路由
- 获得系统路由
- 自定义
    - 获得所有自定义路由
    - 获得单个自定义路由
    - 添加路由
    - 修改路由
    - 删除路由

2. 权限管理

- 列表页
- 删除权限
- 新增权限
- 修改权限
    - 获得所有路由

3. 角色管理

- 列表页
- 删除
- 新增
- 修改
    - 获得所有权限, 路由

4. 用户-角色分配

- 分配列表
- 新增分配
- 修改分配
- 删除分配

有关定义
====

[](#有关定义)

1. 用户

- 用户ID

2. 角色
3. 权限
4. 资源节点

- 路由
- 自定义路由

5. 用户资源分配

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

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

Total

5

Last Release

3669d ago

Major Versions

v0.1 → v1.0.02016-06-12

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3595599?v=4)[niceforbear](/maintainers/niceforbear)[@niceforbear](https://github.com/niceforbear)

---

Top Contributors

[![niceforbear](https://avatars.githubusercontent.com/u/3595599?v=4)](https://github.com/niceforbear "niceforbear (1 commits)")

---

Tags

toolrbacpermission-management

### Embed Badge

![Health badge](/badges/niceforbear-jdbrbac/health.svg)

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

###  Alternatives

[spatie/laravel-permission

Permission handling for Laravel 12 and up

12.9k98.0M1.3k](/packages/spatie-laravel-permission)[santigarcor/laratrust

This package provides a flexible way to add Role-based Permissions to Laravel

2.3k5.6M47](/packages/santigarcor-laratrust)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k3.5M118](/packages/bezhansalleh-filament-shield)[casbin/casbin

a powerful and efficient open-source access control library for php projects.

1.3k1.5M54](/packages/casbin-casbin)[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.

435985.8k4](/packages/owasp-phprbac)[casbin/laravel-authz

An authorization library that supports access control models like ACL, RBAC, ABAC in Laravel.

331361.0k4](/packages/casbin-laravel-authz)

PHPackages © 2026

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