PHPackages                             zelenin/yii2-rbac-module - 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. zelenin/yii2-rbac-module

AbandonedArchivedYii2-extension[Authentication &amp; Authorization](/categories/authentication)

zelenin/yii2-rbac-module
========================

Yii2 RBAC module with generating assignments to DB from RBAC data store file rbac.php

0.3.0(11y ago)231.6k9MITPHP

Since Jun 3Pushed 11y ago1 watchersCompare

[ Source](https://github.com/zelenin/yii2-rbac-module)[ Packagist](https://packagist.org/packages/zelenin/yii2-rbac-module)[ Docs](https://github.com/zelenin/yii2-rbac-module)[ RSS](/packages/zelenin-yii2-rbac-module/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (9)Dependencies (1)Versions (10)Used By (0)

Yii2 RBAC module
================

[](#yii2-rbac-module)

[Yii2](http://www.yiiframework.com) RBAC module with generating assignments to DB from RBAC data storage files. Also "classic" PhpManager is available.

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

[](#installation)

### Composer

[](#composer)

The preferred way to install this extension is through [Composer](http://getcomposer.org/).

Either run

```
php composer.phar require zelenin/yii2-rbac-module "dev-master"

```

or add

```
"zelenin/yii2-rbac-module": "dev-master"

```

to the require section of your `composer.json`

Usage
-----

[](#usage)

### DbManager

[](#dbmanager)

Configure AuthManager component in config:

```
'components' => [
    'authManager' => [
        'class' => \Zelenin\yii\modules\Rbac\components\DbManager::className(),
        'itemFile' => '@common/config/rbac/items.php',
        'assignmentFile' => '@common/config/rbac/assignments.php',
        'ruleFile' => '@common/config/rbac/rules.php',
        'defaultRole' => 'user',
		'roleParam' => 'role' // User model attribute
	]
]
```

Run:

```
php yii migrate --migrationPath=@yii/rbac/migrations/

```

or use sql file in `@yii/rbac/migrations/`

For generating assignments from php storage files run

```
php yii rbac/generate

```

For storage files examples see `example` directory

### PhpManager

[](#phpmanager)

Configure AuthManager component in config:

```
'components' => [
    'authManager' => [
        'class' => \Zelenin\yii\modules\Rbac\components\PhpManager::className(),
        'itemFile' => '@common/config/rbac/items.php',
        'assignmentFile' => '@common/config/rbac/assignments.php',
        'ruleFile' => '@common/config/rbac/rules.php',
        'defaultRole' => 'user',
		'roleParam' => 'role', // User model attribute
	]
]
```

Info
----

[](#info)

See [Yii2 authorization guide](https://github.com/yiisoft/yii2/blob/master/docs/guide/security-authorization.md)

Author
------

[](#author)

[Aleksandr Zelenin](https://github.com/zelenin/), e-mail:

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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

Total

9

Last Release

4093d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0de51e0d5cd7141a2189ae926d4a3c449d5d41fda7c6b63b08869eb3c1e53b9a?d=identicon)[zelenin](/maintainers/zelenin)

---

Top Contributors

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

---

Tags

rbacyii2

### Embed Badge

![Health badge](/badges/zelenin-yii2-rbac-module/health.svg)

```
[![Health](https://phpackages.com/badges/zelenin-yii2-rbac-module/health.svg)](https://phpackages.com/packages/zelenin-yii2-rbac-module)
```

###  Alternatives

[budyaga/yii2-users

Module for manage users and their rights with the support of registration through social services and assigned to each user more than one social service.

409.1k](/packages/budyaga-yii2-users)[letyii/yii2-rbac-cached

Cached for yii2 RBAC

112.2k](/packages/letyii-yii2-rbac-cached)

PHPackages © 2026

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