2017 © Pedro Peláez
 

yii2-extension yii2-rbac-cli

Yii2 module, provide a cli to load initial permission and roles in rbac from a yaml file

image

macfly/yii2-rbac-cli

Yii2 module, provide a cli to load initial permission and roles in rbac from a yaml file

  • Monday, February 26, 2018
  • by Macfly
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,016 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 20 % Grown

The README.md

yii2-rbac-cli

Create role and permission from the command line based on the content of a YAML or JSON file., (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

php composer.phar require --prefer-dist "macfly/yii2-rbac-cli" "*"

or add, (*4)

"macfly/yii2-rbac-cli": "*"

to the require section of your composer.json file., (*5)

Configure

Configure config/console.php as follows, (*6)

  'modules' => [
     ................
    'rbac'  => [
      'class'       => 'macfly\rbac\Module',
    ],
    ................
  ],

Usage

Import static role and permission list

Create a yaml file with le list of static role and permission you want to create, (*7)

# Permission section
permissions:
  list:
    desc: List user
  create:
    desc: Create user
  update:
    desc: Edit user
  profile:
    desc: Edit user profile
  delete:
    desc: Remove user

# Role section
roles:
  view:
    desc: View users
    children:
    - list
    - info
  admin:
    desc: Administration
    children:
    - view

# Assign permission and roles to a specific userid
assign:
  1:
  - admin
  - oauth.admin
  2:
  - user.info

After run the @rbac/yaml@ with the path to your yaml file, (*8)

php yii rbac/load/yaml /tmp/role.yml

Add role or permission to a specific user

You can add some role and permission from the cli to a specific user id., (*9)

php yii rbac/load/add userid permissionOrRoleName

For example to add role 'view' to user with id '1' :, (*10)

php yii rbac/load/add 1 view

The Versions

26/02 2018

dev-master

9999999-dev

Yii2 module, provide a cli to load initial permission and roles in rbac from a yaml file

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

yii2 cli rbac yaml load yml

26/02 2018

0.1.3

0.1.3.0

Yii2 module, provide a cli to load initial permission and roles in rbac from a yaml file

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

yii2 cli rbac yaml load yml

13/12 2017

0.1.2

0.1.2.0

Yii2 module, provide a cli to load initial permission and roles in rbac from a yaml file

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

yii2 cli rbac yaml load yml

11/12 2017

0.1.1

0.1.1.0

Yii2 module, provide a cli to load initial permission and roles in rbac from a yaml file

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

yii2 cli rbac yaml load yml

11/12 2017

0.1.0

0.1.0.0

Yii2 module, provide a cli to load initial permission and roles in rbac from a yaml file

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

yii2 cli rbac yaml load yml

03/08 2017

0.0.3

0.0.3.0

Yii2 module, provide a cli to load initial permission and roles in rbac from a yaml file

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

yii2 cli rbac yaml load yml

05/04 2017

0.0.2

0.0.2.0

Yii2 module, provide a cli to load initial permission and roles in rbac from a yaml file

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

yii2 cli rbac yaml load yml

17/03 2017

0.0.1

0.0.1.0

Yii2 module, provide a cli to load initial permission and roles in rbac from a yaml file

  Sources   Download

BSD-3-Clause

The Requires

 

by Charles DELFLY

yii2 cli rbac yaml load yml