承接 gintonicweb/permissions 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gintonicweb/permissions

Composer 安装命令:

composer require gintonicweb/permissions

包简介

Permissions plugin for CakePHP

README 文档

README

Build Status codecov.io

Permissions plugin for CakePHP

Warning

Do not use, very early stage

Installation

composer require gintonicweb/permissions

In your app's config/bootstrap.php add:

Plugin::load('Permissions');

Usage

In your Auth setup, use ConfigAuthorize for authorization.

public $components = array(
    'Auth' => [
        'authorize' => ['Permissions.Config'],
    ]
);

In your controllers you can now use an array like this to grant permissions to specific actions for specific roles

// Add Role at the top of your controller like this
// use Permissions\Model\Entity\Role;

public $_permissions = [
    Role::ADMIN => '*',
    Role::USER => ['index', 'view'],
];

You can also add the Roles Listener in bootstrap.php if you want to have access to the users role from the Auth component.

// in config/bootstrap.php
use Permissions\Listener\RoleListener;
EventManager::instance()->attach(new RoleListener());

which makes it possible now to do things like

$role = $this->Auth->user('role');
$roleName = Role::types($role);

统计信息

  • 总下载量: 453
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2015-10-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固