2017 © Pedro Peláez
 

yii2-extension yii2-rbac

RBAC Lite for Yii2

image

heimo/yii2-rbac

RBAC Lite for Yii2

  • Friday, July 20, 2018
  • by Heimo
  • Repository
  • 0 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

yii2-rbac

Yii2 rbac 精简版(无对外接口) 仅供无需rbac接口的api应用使用 根据yii2-rest-rbac(https://github.com/windhoney/yii2-rest-rbac)修改, (*1)

安装

composer require heimo/yii2-rbac

使用

配置权限

    'components' => [
        'authManager' => [
            'class' => 'heimo\rbac\components\DbManager', //配置文件
        ],
    ],

    'as access' => [
        'class' => 'heimo\rbac\components\AccessControl',
        'allowActions' => [//允许访问的节点,可自行添加
            'login/*',
            'logout/*',
            'callback/*',
        ]
    ],

创建所需要的表

  1. 菜单表menu
yii migrate --migrationPath=@vendor/heimo/yii2-rbac/migrations
  1. rbac相关权限表
yii migrate --migrationPath=@yii/rbac/migrations/

授权认证方式

  1. url中增加 access_token 参数 或者 header中增加 Authorization 参数,值为 Bearer [access_token值], (*2)

  2. UserModel中实现 loginByAccessToken($access_token) 方法, (*3)

The Versions

20/07 2018

dev-master

9999999-dev

RBAC Lite for Yii2

  Sources   Download

MIT

The Requires

 

by Heimo-He

auth yii rbac restful admin

20/07 2018

v1.0.1

1.0.1.0

RBAC Lite for Yii2

  Sources   Download

MIT

The Requires

 

by Heimo-He

auth yii rbac restful admin

20/07 2018

v1.0.0

1.0.0.0

RBAC Lite for Yii2

  Sources   Download

MIT

The Requires

 

by Heimo-He

auth yii rbac restful admin