2017 © Pedro Peláez
 

yii2-extension yii2-rbac-command

Extension for RBAC rules update for Yii2

image

rmrevin/yii2-rbac-command

Extension for RBAC rules update for Yii2

  • Wednesday, March 8, 2017
  • by rmrevin
  • Repository
  • 1 Watchers
  • 5 Stars
  • 2,341 Installations
  • PHP
  • 3 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 14 Versions
  • 3 % Grown

The README.md

Yii 2 RBAC update command

This extension provides a console command to update the RBAC rules, roles and permissions for Yii framework 2.0 applications., (*1)

Installation

composer require "rmrevin/yii2-rbac-command:~1.6"

Configuration

Create new console command extends \rmrevin\yii\rbac\Command (example), (*2)

<?php

namespace app\commands;

class RbacCommand extends \rmrevin\yii\rbac\Command
{

    protected function rules()
    {
        // ...
    }

    protected function roles()
    {
        // ...
    }

    protected function permissions()
    {
        // ...
    }

    protected function inheritanceRoles()
    {
        // ...
    }

    protected function inheritancePermissions()
    {
        // ...
    }
}

In console application config (example: /protected/config/console.php), (*3)

<?
return [
  // ...
    'controllerMap' => [
        // ...
        'rbac' => [
            'class' => 'app\commands\RbacCommand',
            'batchSize' => 1000,
            'forceAssign' => ['user'], // force assign user role for all users
            'assignmentsMap' => [
                'frontend.old' => 'frontend.new', // after next update all `frontend.old` will be replaced by `frontend.new`
            ],
            'useTransaction' => true,
            'useCache' => true,
        ],
    ],
    // ...
];

Usage

Execute command in command line, (*4)

yii rbac/update

The Versions

08/03 2017

dev-master

9999999-dev

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

08/03 2017

1.6.1

1.6.1.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

08/03 2017

1.6.0

1.6.0.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

08/06 2016

1.5.0

1.5.0.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

23/12 2015

1.4.0

1.4.0.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

19/06 2015

1.3.1

1.3.1.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

19/06 2015

1.3.0

1.3.0.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

08/06 2015

1.2.0

1.2.0.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

24/04 2015

1.1.3

1.1.3.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

24/04 2015

1.1.2

1.1.2.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

24/04 2015

1.1.1

1.1.1.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

24/04 2015

1.1.0

1.1.0.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

24/04 2015

1.0.1

1.0.1.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac

22/04 2015

1.0.0

1.0.0.0

Extension for RBAC rules update for Yii2

  Sources   Download

MIT

The Requires

 

command yii rbac