2017 © Pedro Peláez
 

package yii2-rbac-module

Module to manage roles and permissions for the Yii2 Framework.

image

itstructure/yii2-rbac-module

Module to manage roles and permissions for the Yii2 Framework.

  • Saturday, June 16, 2018
  • by itstructure
  • Repository
  • 0 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 78 % Grown

The README.md

Yii2 RBAC module

Introduction

Latest Stable Version Latest Unstable Version License Total Downloads Build Status Scrutinizer Code Quality, (*1)

RBAC module - Module for the Yii2 framework, which provides management with the next data: - Roles - Permissions - Assign roles for users(profiles), (*2)

RBAC extension structure, (*3)

Dependencies

  • php >= 7.1
  • composer
  • MySql >= 5.5

Installation

General from remote repository

Via composer:, (*4)

composer require itstructure/yii2-rbac-module "~3.0.5", (*5)

If you are testing this package from local server directory

In application composer.json file set the repository, like in example:, (*6)

"repositories": [
    {
        "type": "path",
        "url": "../yii2-rbac-module",
        "options": {
            "symlink": true
        }
    }
],

Here,, (*7)

yii2-rbac-module - directory name, which has the same directory level like application and contains yii2 rbac module., (*8)

Then run command:, (*9)

composer require itstructure/yii2-rbac-module:dev-master --prefer-source, (*10)

Addition components

In accordance with the documentation for Yii2, set authManager for application:, (*11)

'components' => [
    'authManager' => [
        'class' => 'yii\rbac\DbManager',
    ],
    // ...
],

In accordance with the documentation for Yii2, run command:, (*12)

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

Usage

Main properties

  • The name of module: rbac
  • The namespace for used classes: Itstructure\RbacModule.
  • The alias to access in to module root directory: @rbac., (*13)

  • There is not a layout ! It's taken from application layout main by default or how it is configured. You cat set layout attribute in module by custom., (*14)

  • View component is taken by default from the framework like yii\web\View. You cat set view component in module by custom., (*15)

Application config

Base application config must be like in example below:, (*16)

use Itstructure\RbacModule\Module;
use Itstructure\RbacModule\controllers\{RoleController, PermissionController, ProfileController};
'modules' => [
    'rbac' => [
        'class' => Module::class,
        'controllerMap' => [
            'roles' => RoleController::class,
            'permissions' => PermissionController::class,
            'profiles' => ProfileController::class,
        ],
    ],
],

Useful module attributes

You can set the following attributes in a module config:, (*17)

  • loginUrl - set url to be redirected if you are not authorized.
  • accessRoles - The roles of users who are allowed access to work with this package.
  • urlPrefix - Url prefix for redirect and view links (Default is empty).
  • urlPrefixNeighbor - Url prefix for redirect and view links of neighbor entity (Default is empty).

License

Copyright © 2018-2023 Andrey Girnik girnikandrey@gmail.com., (*18)

Licensed under the MIT license. See LICENSE.txt for details., (*19)

The Versions

16/06 2018

dev-master

9999999-dev

Module to manage roles and permissions for the Yii2 Framework.

  Sources   Download

MIT

The Requires

 

yii2 module yii 2 rbac

16/06 2018

1.1.0

1.1.0.0

Module to manage roles and permissions for the Yii2 Framework.

  Sources   Download

MIT

The Requires

 

yii2 module yii 2 rbac

13/05 2018

1.0.0

1.0.0.0

Module to manage roles and permissions for the Yii2 Framework.

  Sources   Download

MIT

The Requires

 

yii2 module yii 2 rbac

26/03 2018

1.3.3

1.3.3.0

Module to manage roles and permissions for the Yii2 Framework.

  Sources   Download

MIT

The Requires

 

yii2 module yii 2 rbac

23/03 2018

1.3.2

1.3.2.0

Module to manage roles and permissions for the Yii2 Framework.

  Sources   Download

MIT

The Requires

 

yii2 module yii 2 rbac

17/03 2018

1.3.1

1.3.1.0

Module to manage roles and permissions for the Yii2 Framework.

  Sources   Download

MIT

The Requires

 

yii2 module yii 2 rbac

13/02 2018

1.3.0

1.3.0.0

Module to manage roles and permissions for the Yii2 Framework.

  Sources   Download

MIT

The Requires

 

yii2 module yii 2 rbac

13/02 2018

1.2.0

1.2.0.0

Module to manage roles and permissions for the Yii2 Framework.

  Sources   Download

MIT

The Requires

 

yii2 module yii 2 rbac