PHPackages                             michnaadam33/yii2-rbac-console - 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. [CLI &amp; Console](/categories/cli)
4. /
5. michnaadam33/yii2-rbac-console

ActiveYii2-extension[CLI &amp; Console](/categories/cli)

michnaadam33/yii2-rbac-console
==============================

This is common controller to Yii2 Rbac module

1.1(10y ago)064[1 issues](https://github.com/michnaadam33/yii2-rbac-console/issues)MITPHP

Since Sep 24Pushed 9y ago2 watchersCompare

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

READMEChangelogDependencies (1)Versions (2)Used By (0)

Rbac console
============

[](#rbac-console)

============

This is common controller to Yii2 Rbac module
---------------------------------------------

[](#this-is-common-controller-to-yii2-rbac-module)

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

[](#installation)

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

Either run

```

php composer.phar require --prefer-dist michnaadam33/yii2-rbac-console "*"

```

or add

```

"michnaadam33/yii2-rbac-console": "*"

```

to the require section of your `composer.json` file.

Read about RBAC
---------------

[](#read-about-rbac)

Create init action
------------------

[](#create-init-action)

You can config a default role on yii2 config:

```
'components' => [
        'rbac-console' => [
            'class' => 'michnaadam33\rbacConsole\Collection',
            'rule_hierarchy' => [
                'common\rbac\AuthorPostRule'
            ],
           'permission_hierarchy' => [
                'createPost',
                'deletePost',
                [
                    'name' =>'deleteOwnPost',
                    'rule' => 'RULE_AUTHOR_POST',
                    'children' => ['deletePost']
                ],
           ],
           'role_hierarchy' => [
                'ROLE_GUEST',
                'ROLE_CHILD',
                'ROLE_USER',
                [
                     'name' =>'ROLE_ADMIN',
                     'children' =>['ROLE_USER'],
                     'permissions' => [
                          'createTravel',
                               'createPost',
                               'deletePost',
                     ]
                ],
           ],
        ...
]

```

When you run `yii rbac/init` will be five roles:

- ROLE\_GUEST
- ROLE\_CHILD
- ROLE\_USER
- ROLE\_ADMIN
- ROLE\_SUPER\_ADMIN

Posible action:
---------------

[](#posible-action)

Reset password.

```
yii rbac/reset-password

```

Assign user.

```
yii rbac/assign

```

Revoke user.

```
yii rbac/revoke

```

Show all permissions

```
yii rbac/show-all-permissions

```

Show all roles

```
yii rbac/show-all-roles

```

Show all roles of user.

```
yii rbac/show-role

```

Show all permission from user or role.

```
yii rbac/show-permission  [--by=role]

```

Remove permission child from user or role.

```
yii rbac/remove-child-permission  [--by=role]

```

Remove role child from role.

```
yii rbac/remove-child-role  childName>

```

Add child role to role.

```
yii rbac/add-child-role

```

Add child premission to user or role.

```
yii rbac/add-child-permission   [--by=role]

```

Create role.

```
yii rbac/create-role

```

Create permission

```
yii rbac/create-permission

```

Remove role.

```
yii rbac/remove-role

```

Remove permission.

```
yii rbac/remove-permission

```

### License

[](#license)

And of course:

MIT: [LICENSE](../master/LICENSE.md)

====

> Adam Michna [http://symetrland.com](http://symetrland.com/)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

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

Unknown

Total

1

Last Release

3936d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4cfeec0683b34a23202513194cfe2e2caac368cf316ddc1811d22023be37e3ea?d=identicon)[michnaadam33](/maintainers/michnaadam33)

---

Top Contributors

[![michnaadam33](https://avatars.githubusercontent.com/u/8986842?v=4)](https://github.com/michnaadam33 "michnaadam33 (15 commits)")

---

Tags

consolerbacyii2extension

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[samdark/yii2-webshell

A web shell that allows to run yii console commands and create your own commands.

22886.7k2](/packages/samdark-yii2-webshell)[toriphes/yii2-console-runner

Runs console command in yii web application

29251.3k](/packages/toriphes-yii2-console-runner)[vova07/yii2-console-runner-extension

An extension for running console commands on background in Yii framework.

88211.8k2](/packages/vova07-yii2-console-runner-extension)[fedemotta/yii2-cronjob

Yii2 extension to help in the creation of automated console scripts

2234.3k](/packages/fedemotta-yii2-cronjob)[skeeks/cms

SkeekS CMS — control panel and tools based on php framework Yii2

13825.8k58](/packages/skeeks-cms)

PHPackages © 2026

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