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

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

wdmg/yii2-rbac
==============

RBAC management module

1.2.0(2y ago)255131MITPHP

Since Jan 26Pushed 2y ago3 watchersCompare

[ Source](https://github.com/wdmg/yii2-rbac)[ Packagist](https://packagist.org/packages/wdmg/yii2-rbac)[ Docs](https://github.com/wdmg/yii2-rbac)[ RSS](/packages/wdmg-yii2-rbac/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (18)Used By (1)

[![Yii2](https://camo.githubusercontent.com/dccea8d8aeed2f3bbad8d539958795bf54a03a62c61f496084516c1b1845a9ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72657175697265642d596969325f76322e302e33332d626c75652e737667)](https://packagist.org/packages/yiisoft/yii2)[![Downloads](https://camo.githubusercontent.com/daffcbca79fbebdb925684fca9985df17d2b223c3891887771274f3651c8f6a2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77646d672f796969322d726261632e737667)](https://packagist.org/packages/wdmg/yii2-rbac)[![Packagist Version](https://camo.githubusercontent.com/f6a7b94771ac91831008de6cc1156cabcf193232d2225708a5342db52c1faa72/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77646d672f796969322d726261632e737667)](https://packagist.org/packages/wdmg/yii2-rbac)[![Progress](https://camo.githubusercontent.com/315c55c18b58f54e699e6de550cbbec72c9adeebced7d22e2822458e07822fb3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d696e5f646576656c6f706d656e742d7265642e737667)](https://camo.githubusercontent.com/315c55c18b58f54e699e6de550cbbec72c9adeebced7d22e2822458e07822fb3/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d696e5f646576656c6f706d656e742d7265642e737667)[![GitHub license](https://camo.githubusercontent.com/858d74c310012bfcf639b0aad03db0f253b68ffcef2394de19724c026cade1a8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77646d672f796969322d726261632e737667)](https://github.com/wdmg/yii2-rbac/blob/master/LICENSE)

Yii2 RBAC Module
================

[](#yii2-rbac-module)

RBAC management module for Yii2

Requirements
============

[](#requirements)

- PHP 5.6 or higher
- Yii2 v.2.0.33 and newest
- [Yii2 Users](https://github.com/wdmg/yii2-users) module

Installation
============

[](#installation)

To install the module, run the following command in the console:

`$ composer require "wdmg/yii2-rbac:dev-master"`

After configure db connection, run the following command in the console:

`$ php yii rbac/init`

And select the operation you want to perform:

1. Apply all module migrations
2. Add base roles and rules for users
3. Revert all module migrations

Migrations
==========

[](#migrations)

In any case, you can execute the migration and create the initial data, run the following command in the console:

`$ php yii migrate --migrationPath=@vendor/wdmg/yii2-rbac/migrations`

Configure
=========

[](#configure)

To add a module to the project, add the following data in your configuration file:

```
'components' => [
    ...
    'authManager' => [
        'class' => 'yii\rbac\DbManager',
        ...
    ],
    ...
],
'modules' => [
    ...
    'rbac' => [
        'class' => 'wdmg\rbac\Module',
        'routePrefix' => 'admin'
    ],
    ...
],

```

\[Notice\] You should configure "authManager" component in config to use database before executing migrations.

Routing
=======

[](#routing)

Use the `Module::dashboardNavItems()` method of the module to generate a navigation items list for NavBar, like this:

```

```

Status and version \[in progress development\]
==============================================

[](#status-and-version-in-progress-development)

- v.1.2.0 - Update copyrights, fix nav menu
- v.1.1.10 - RBAC implementation for related modules
- v.1.1.9 - Added pagination, up to date dependencies
- v.1.1.8 - Fixed deprecated class declaration
- v.1.1.7 - Fix Invalid datetime format
- v.1.1.6 - Added extra options to composer.json and navbar menu icon

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity69

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

Recently: every ~340 days

Total

17

Last Release

1042d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1635637?v=4)[Alexsander Vyshnyvetskyy](/maintainers/alex-wdmg)[@alex-wdmg](https://github.com/alex-wdmg)

---

Top Contributors

[![alex-wdmg](https://avatars.githubusercontent.com/u/1635637?v=4)](https://github.com/alex-wdmg "alex-wdmg (66 commits)")

---

Tags

rbacyii2yii2-rbacwdmgrbac manager

### Embed Badge

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

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

###  Alternatives

[yii2mod/yii2-rbac

RBAC management module for Yii2

150351.4k7](/packages/yii2mod-yii2-rbac)[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)
