2017 © Pedro Peláez
 

cakephp-plugin guardian

ACL plugin for CakePHP 3.x

image

boleiros/guardian

ACL plugin for CakePHP 3.x

  • Saturday, May 20, 2017
  • by flavianohonorato
  • Repository
  • 3 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Guardian plugin for CakePHP ACL

Installation

You can install this plugin into your CakePHP application using composer., (*1)

The recommended way to install composer packages is:, (*2)

composer require boleiros/guardian

Enable Plugin

// config/bootstrap.php

Plugin::load('Guardian', ['bootstrap' => true, 'routes' => true]);

Or, in your terminal:, (*3)

bin/cake plugin load -b -r Gardian

Run Migrations

bin/cake migrations migrate --plugin Guardian

Usage

  1. import and use the Guardian Trait on your user Model
//User.php
<?php
namespace App\Model\Entity;

use Cake\ORM\Entity;
use Guardian\Model\Traits\Guardian;

class User extends Entity
{

    use Guardian;
    ....

  1. call the method passing the name of the permission: $user->hasPermission('users.index')

The Versions

20/05 2017

dev-master

9999999-dev https://cakephpbrasil.com.br

ACL plugin for CakePHP 3.x

  Sources   Download

MIT

The Requires

 

The Development Requires

plugin cakephp templates