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

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

wuxian/sgame-rbac
=================

permission and role for php

3.7(5y ago)01.7k1MITPHP

Since Nov 27Pushed 5y ago1 watchersCompare

[ Source](https://github.com/wuxian12/sgame-rbac)[ Packagist](https://packagist.org/packages/wuxian/sgame-rbac)[ RSS](/packages/wuxian-sgame-rbac/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (13)Used By (1)

该组件是RBAC权限角色组件，适合各种php框架,方便扩展，例如角色表名，字段可以自由定义
---------------------------------------------

[](#该组件是rbac权限角色组件适合各种php框架方便扩展例如角色表名字段可以自由定义)

所有的方法可以参照 接口RbacInterface,数据驱动可以自由添加
------------------------------------

[](#所有的方法可以参照-接口rbacinterface数据驱动可以自由添加)

支持4张表的BRAC和5张表的RBAC
-------------------

[](#支持4张表的brac和5张表的rbac)

```
		$obj = new Rbac($config); OR new RbacFactory();
        $data['identity'] = 'test/11,test/44';  //后端提供了接口
        $data['url'] = 'test/66';  //前端url
		$data['is_web'] = 1;  //是否是前端页面
        $data['name'] = '测试子类33';
        $data['parent_id'] = 12;
		//添加
        $res = $obj->addPermission($data);
		//编辑
        $res = $obj->editPermission(14,$data);
		//删除
        $res = $obj->delPermission([14]);
		//左侧边栏【只展示前端】
        $res = $obj->menu(1);
		//所有权限【包括前后端的】
        $res = $obj->permissionList();
		//单个权限信息
        $res = $obj->getPermissionInfo(16);

        // $data['name'] = '测试';
		//添加
        // //$res = $obj->addRole($data);
		//编辑
        // $res = $obj->editRole(10,$data);
		//删除
        //$res = $obj->delRole([10]);
		//列表
        //$res = $obj->roleList(1);
		//单个角色信息
        //$res = $obj->getRoleInfo(10);
		//所有角色
        //$res = $obj->roleAll();

        // $data['name'] = 'test';
        // $data['password'] = '12345678';
        // $data['role_id'] = 10;
		//添加
        //$res = $obj->addAdmin($data);
		//编辑
        //$res = $obj->editAdmin(15,$data);
		//删除
        //$res = $obj->delAdmin([15]);
		//用户列表
        //$res = $obj->adminList(3);
		//单个用户信息
        //$res = $obj->getAdminInfo(15);

		//添加角色权限
        //$res = $obj->addPermissionIdsRoleId(10,'10,12,13');
		//获取角色的权限id
        //$res = $obj->getPermissionIdsByRoleId(10);

		//判断用户是否有权限访问接口
        $res = $obj->permissionIsOk(14,'api');
```

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

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

12

Last Release

1980d ago

Major Versions

1.0 → 2.02020-11-30

2.2 → 3.02020-12-02

### Community

Maintainers

![](https://www.gravatar.com/avatar/66161bdde4070dab2af10955612e8f00b9fd26903e606380c07446f8ffc79315?d=identicon)[wuxian](/maintainers/wuxian)

---

Top Contributors

[![wuxian12](https://avatars.githubusercontent.com/u/22463471?v=4)](https://github.com/wuxian12 "wuxian12 (18 commits)")

---

Tags

phprbac

### Embed Badge

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

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

###  Alternatives

[santigarcor/laratrust

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

2.3k5.4M43](/packages/santigarcor-laratrust)[casbin/laravel-authz

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

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

PHPackages © 2026

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