PHPackages                             hscstudio/yii2-mimin - 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. hscstudio/yii2-mimin

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

hscstudio/yii2-mimin
====================

Simple RBAC Manager

v1.1.5(7y ago)5010.4k33[3 issues](https://github.com/hscstudio/yii2-mimin/issues)3MITPHP

Since Nov 10Pushed 7y ago8 watchersCompare

[ Source](https://github.com/hscstudio/yii2-mimin)[ Packagist](https://packagist.org/packages/hscstudio/yii2-mimin)[ RSS](/packages/hscstudio-yii2-mimin/feed)WikiDiscussions master Synced today

READMEChangelog (9)Dependencies (2)Versions (11)Used By (3)

Yii2 Mimin
==========

[](#yii2-mimin)

Simple RBAC Manager fo Yii 2.0. Minify of [yii2-admin](https://github.com/mdmsoft/yii2-admin) extension with awesome features

[![Latest Stable Version](https://camo.githubusercontent.com/ac9df5c85f4fc41fd42f5eea97bb06baad29a21f3086e7ddc8f03134cdf718e4/68747470733a2f2f706f7365722e707567782e6f72672f68736373747564696f2f796969322d6d696d696e2f762f737461626c65)](https://packagist.org/packages/hscstudio/yii2-mimin) [![Total Downloads](https://camo.githubusercontent.com/c14df9ef07eb340026399f53bf9360042ad75ef31fb740cddb1b1cf6b84ed76c/68747470733a2f2f706f7365722e707567782e6f72672f68736373747564696f2f796969322d6d696d696e2f646f776e6c6f616473)](https://packagist.org/packages/hscstudio/yii2-mimin) [![Latest Unstable Version](https://camo.githubusercontent.com/69fcc512c94c9d64da28d5ba2017b63765bfe3495147f2e4839ba70d9394ae55/68747470733a2f2f706f7365722e707567782e6f72672f68736373747564696f2f796969322d6d696d696e2f762f756e737461626c65)](https://packagist.org/packages/hscstudio/yii2-mimin) [![License](https://camo.githubusercontent.com/42d659a738bbf51d3dd7cab64f9cb8e09d8722ace3bfa03884a74644cd17070d/68747470733a2f2f706f7365722e707567782e6f72672f68736373747564696f2f796969322d6d696d696e2f6c6963656e7365)](https://packagist.org/packages/hscstudio/yii2-mimin)

Attention
---------

[](#attention)

Before you install and use this extension, then make sure that your application has been using the login authentication to the database. especially for yii basic template. Because without it, this extension will produce error and useless.

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist hscstudio/yii2-mimin "~1.1.5"

```

or add

```
"hscstudio/yii2-mimin": "~1.1.5"

```

or add this for install last change

```
"hscstudio/yii2-mimin": "~1.*"

```

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

Configuration
-------------

[](#configuration)

Once the extension is installed, simply use it in your code by :

in config

```
'as access' => [
     'class' => '\hscstudio\mimin\components\AccessControl',
	 'allowActions' => [
		// add wildcard allowed action here!
		'site/*',
		'debug/*',
		'mimin/*', // only in dev mode
	],
],
...,
'modules' => [
	'mimin' => [
		'class' => '\hscstudio\mimin\Module',
	],
	...
],
'components' => [
	'authManager' => [
		'class' => 'yii\rbac\DbManager', // only support DbManager
	],
],
```

Because this extension use 'yii\\rbac\\DbManager'as authManager, so You should migrate rbac sql first:

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

If You use Yii 2.0.6 version or newer, so then migrate custom table for this extension

`yii migrate --migrationPath=@hscstudio/mimin/migrations`

But if You install Yii 2.0.5 version or older, so then migrate custom table for this extension

`yii migrate --migrationPath=@hscstudio/mimin/migrations/old`

Usage
-----

[](#usage)

This RBAC manager have three main page, they are:

### Route

[](#route)

To get all action route from application. In here, You can on / off permission so not shown in menu role, rename alias/type of action route, so easy readable by end user. You can then access `Route` through the following URL:

```
http://localhost/path/to/index.php?r=mimin/route

```

### Role

[](#role)

To define level access of user, what he superadmin?, staff?, cashier? etc. In this menu, You can assign permission / action route (actions in application, they are create, update, delete, etc) to role. You can then access `Role` through the following URL:

```
http://localhost/path/to/index.php?r=mimin/role

```

Below screenshoot of route assignment to role [![Screenshoot Role](screenshoot.png "Screenshoot Role")](screenshoot.png)

### User

[](#user)

For standard user management, create/update/delete user, and assign role to user. You can then access `User` through the following URL:

```
http://localhost/path/to/index.php?r=mimin/user

```

We recommendate you for activate pretty URL.

Implementation on Widgets
-------------------------

[](#implementation-on-widgets)

### Example dynamic button

[](#example-dynamic-button)

It is used for checking if route right to access

```
if ((Mimin::checkRoute($this->context->id.'/create'))){
    echo Html::a('Create Note', ['create'], ['class' => 'btn btn-success']);
}

// in other case maybe You want ensure same of route so You can add parameter strict true
if ((Mimin::checkRoute($this->context->id.'/create',true))){
```

### Example dynamic menu

[](#example-dynamic-menu)

It is is used for filtering right access menu

```
use hscstudio\mimin\components\Mimin;
$menuItems = [
    ['label' => 'Home', 'url' => ['/site/index']],
    ['label' => 'About', 'url' => ['/site/about']],
    ['label' => 'Contact', 'url' => ['/site/contact']],
];

if (\Yii::$app->user->isGuest){
    $menuItems[] = ['label' => 'Login', 'url' => ['/site/login']];
}
else{
    $menuItems[] = ['label' => 'App', 'items' => [
        ['label' => 'Category', 'url' => ['/category/index']],
        ['label' => 'Product', 'url' => ['/product/index']],
        ['label' => 'Cart', 'url' => ['/cart/index']],
    ]];
    $menuItems[] = [
        'label' => 'Logout (' . \Yii::$app->user->identity->username . ')',
        'url' => ['/site/logout'],
        'linkOptions' => ['data-method' => 'post']
    ];
}

$menuItems = Mimin::filterMenu($menuItems);
// in other case maybe You want ensure same of route so You can add parameter strict true
// $menuItems = Mimin::filterMenu($menuItems,true);

echo Nav::widget([
    'options' => ['class' => 'navbar-nav navbar-right'],
    'items' => $menuItems,
]);
```

### Example dynamic action column template

[](#example-dynamic-action-column-template)

It is used for filtering template of Gridview Action Column

```
use hscstudio\mimin\components\Mimin;
echo GridView::widget([
    'dataProvider' => $dataProvider,
    'filterModel' => $searchModel,
    'columns' => [
        ...,
        [
          'class' => 'yii\grid\ActionColumn',
          'template' => Mimin::filterActionColumn([
              'update','delete','download'
          ],$this->context->route),
          ...
        ]
    ]
]);
```

How to Contribute
-----------------

[](#how-to-contribute)

This tools is an OpenSource project so your contribution is very welcome.

In order to get started:

- Install this in your local (read installation section)
- Clone this repository.
- Check [README.md](README.md).
- Send [pull requests](https://github.com/hscstudio/yii2-mimin/pulls).

Aside from contributing via pull requests you may [submit issues](https://github.com/hscstudio/yii2-mimin/issues).

Our Team
--------

[](#our-team)

- [Hafid Mukhlasin](http://www.hafidmukhlasin.com) - Project Leader / Indonesian Yii developer.

We'd like to thank our [contributors](https://github.com/hscstudio/yii2-mimin/graphs/contributors) for improving this tools. Thank you!

Jakarta - Indonesia

Buku Panduan
------------

[](#buku-panduan)

Tutorial tentang dasar-dasar RBAC atau access controll di Yii 2 dan panduan yii2-mimin dibahas secara komprehensif di buku saya ini

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community26

Small or concentrated contributor base

Maturity69

Established project with proven stability

 Bus Factor1

Top contributor holds 73.5% 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 ~136 days

Recently: every ~284 days

Total

10

Last Release

2664d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/abb981dd0ea03974df1363d4c0eeed1b4dafeea047ad68ec31f02e3f63e3e530?d=identicon)[hscstudio](/maintainers/hscstudio)

---

Top Contributors

[![hscstudio](https://avatars.githubusercontent.com/u/2976897?v=4)](https://github.com/hscstudio "hscstudio (25 commits)")[![chabibnr](https://avatars.githubusercontent.com/u/4100006?v=4)](https://github.com/chabibnr "chabibnr (3 commits)")[![chiliman-oOo](https://avatars.githubusercontent.com/u/7079517?v=4)](https://github.com/chiliman-oOo "chiliman-oOo (2 commits)")[![luckynvic](https://avatars.githubusercontent.com/u/4830453?v=4)](https://github.com/luckynvic "luckynvic (2 commits)")[![m-alfan](https://avatars.githubusercontent.com/u/17586936?v=4)](https://github.com/m-alfan "m-alfan (1 commits)")[![virbo](https://avatars.githubusercontent.com/u/2990842?v=4)](https://github.com/virbo "virbo (1 commits)")

---

Tags

yii2extension

### Embed Badge

![Health badge](/badges/hscstudio-yii2-mimin/health.svg)

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

###  Alternatives

[lowbase/yii2-user

Yii2 user module

131.5k2](/packages/lowbase-yii2-user)[kakadu-dev/yii2-jwt-auth

Extension provide JWT auth for Yii2

105.8k](/packages/kakadu-dev-yii2-jwt-auth)

PHPackages © 2026

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