2017 © Pedro Peláez
 

yii2-extension yii2-rbac

RBAC manager for Yii framework

image

wsdslm/yii2-rbac

RBAC manager for Yii framework

  • Sunday, March 27, 2016
  • by wsdslm
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Features

  • WEB UI Manager
  • Route Access Filter

Todo

  • I18n

Install

via Composer, (*1)

composer require wsdslm/yii2-rbac

Config

# config/web.php
'components' => [
    'authManager' => [
        'class' => yii\rbac\DbManager::className(),
    ]
],
'modules' => [
    'rbac' => [
        'class' => ws\rbac\Module::className(),
    ]
],

database migration, (*2)

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

Usage

use Route Access Filter

  1. add ws\rbac\components\RouteAccessFilter for app\controllers\SiteController, (*3)

    use ws\rbac\components\RouteAccessFilter;
    
    public function behaviors()
    {
        return [
            'rbac' => [
                'class' => RouteAccessFilter::className(),
                'only' => ['t'],
            ],
        ];
    }
    
    public function actionT()
    {
        return __METHOD__;
    }
  2. Create Route access Permission at http://localhost:8080/rbac/permission/create, (*4)

    1. Permission Name basic.site.t (module_id.controller_id.action_id)
  3. Create Role at http://localhost:8080/rbac/role/create
    1. Role Name admin
  4. Manager Role at http://localhost:8080/rbac/role/index
    1. Click icon cog
    2. Add Child basic.site.t
  5. Assign Role for User at http://localhost:8080/rbac/assign

The Versions

27/03 2016

dev-master

9999999-dev

RBAC manager for Yii framework

  Sources   Download

The Requires

 

by Avatar wsdslm

27/03 2016

1.0.0

1.0.0.0

RBAC manager for Yii framework

  Sources   Download

The Requires

 

by Avatar wsdslm