2017 © Pedro Peláez
 

library user-rbac

A Zend Framework module to easily integrate ZfcUser and ZfcRbac

image

rarog/user-rbac

A Zend Framework module to easily integrate ZfcUser and ZfcRbac

  • Thursday, April 19, 2018
  • by rarog
  • Repository
  • 1 Watchers
  • 0 Stars
  • 357 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 12 Versions
  • 11 % Grown

The README.md

UserRbac

Master Branch Build Status Coverage Status Latest Stable Version Latest Unstable Version Total Downloads, (*1)

A Zend Framework module to easily integrate ZfcUser and ZfcRbac, (*2)

Introduction

Are your tired of doing tedious work of integrating ZfcUser and ZfcRbac again and again? Then, you are in the right place. This module comes to save us. This module, simply, gets roles of a user from the database and passes it to the ZfcRbac. You only need to focus on the domain logic of your application. No more repetive tasks., (*3)

Versions

Please use below table to figure out what version of ZfcUser you should use., (*4)

UserRbac version Supported Zend Framework version
0.x <= 2.5
1.x >= 2.6 < 3
2.x >= 3.x

Features

  1. No need to write code for integrating ZfcUser and ZfcRbac
  2. A user`s roles are easily retrievable from the database
  3. Addition of SmartRedirectStrategy

Installation

  • Add "rarog/user-rbac": "^2.0", to your composer.json and run php composer.phar update
  • Import the schema for corresponding database in data folder
  • Enable this module in config/application.config.php
  • Copy file located in vendor/rarog/user-rbac/config/user-rbac.global.php.dist to ./config/autoload/user-rbac.global.php and change the values as you wish.

What it does

This module registers an identity provider and provides some configuration to ZfcRbac. So, you don't need to create your own identity provider. See config/module.config.php., (*5)

How it works

It gets a user's roles from the table user_role_linker and passes the roles to ZfcRbac. This module is best suited when you use ZfcRbac\Role\InMemoryRoleProvider as role provider., (*6)

Options

Check the options available in vendor/rarog/user-rbac/config/user-rbac.global.php.dist., (*7)

SmartRedirectStrategy

This module comes with a new strategy called SmartRedirectStrategy. This simply redirects to ZfcUser's login page or route, zfcuser/login only when the user is unauthenticated. Otherwise, it shows a 403 error page!, (*8)

Usage

public function onBootstrap(EventInterface $e)
{
    $app = $e->getApplication();
    $sm = $app->getServiceManager();
    $em = $app->getEventManager();

    $listener = $sm->get(\UserRbac\View\Strategy\SmartRedirectStrategy::class);
    $listener->attach($em);
}

Known Limitation

This module is only ideal for small and medium web sites as a quick and easy way. For complicated use cases, it may not suit your need., (*9)

The Versions

19/04 2018

dev-master

9999999-dev https://github.com/rarog/UserRbac

A Zend Framework module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar ojhaujjwal
by Andrej Sinicyn

zf2 module zendframework zf3

19/04 2018

v2.0.0

2.0.0.0 https://github.com/rarog/UserRbac

A Zend Framework module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar ojhaujjwal
by Andrej Sinicyn

module zendframework zf3

19/04 2018

1.x-dev

1.9999999.9999999.9999999-dev https://github.com/rarog/UserRbac

A Zend Framework module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar ojhaujjwal
by Andrej Sinicyn

zf2 module zendframework zf3

19/04 2018

v1.0.3

1.0.3.0 https://github.com/rarog/UserRbac

A Zend Framework module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar ojhaujjwal
by Andrej Sinicyn

zf2 module zendframework zf3

06/06 2017

dev-proper-zf3

dev-proper-zf3 https://github.com/rarog/UserRbac

A Zend Framework module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar ojhaujjwal
by Andrej Sinicyn

zf2 module zendframework zf3

04/06 2017

v1.0.2

1.0.2.0 https://github.com/rarog/UserRbac

A Zend Framework module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar ojhaujjwal
by Andrej Sinicyn

zf2 module zendframework zf3

25/05 2017

v1.0.1

1.0.1.0 https://github.com/rarog/UserRbac

A Zend Framework module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar ojhaujjwal
by Andrej Sinicyn

zf2 module zendframework zf3

27/04 2017

v1.0

1.0.0.0 https://github.com/rarog/UserRbac

A Zend Framework module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar ojhaujjwal
by Andrej Sinicyn

zf2 module zendframework zf3

05/04 2014

0.1.1

0.1.1.0 https://github.com/ojhaujjwal/UserRbac

A Zend Framework 2 module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

MIT

The Requires

 

by Avatar ojhaujjwal

zf2 module zendframework

16/02 2014

0.0.1

0.0.1.0 https://github.com/ojhaujjwal/UserRbac

A Zend Framework 2 module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

GNU GENERAL PUBLIC LICENSE

The Requires

 

by Avatar ojhaujjwal

zf2 module zendframework

07/02 2014

0.0.1-beta2

0.0.1.0-beta2 https://github.com/ojhaujjwal/UserRbac

A Zend Framework 2 module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

GNU GENERAL PUBLIC LICENSE

The Requires

 

by Avatar ojhaujjwal

zf2 module zendframework

04/02 2014

0.0.1-beta1

0.0.1.0-beta1 https://github.com/ojhaujjwal/UserRbac

A Zend Framework 2 module to easily integrate ZfcUser and ZfcRbac

  Sources   Download

GNU GENERAL PUBLIC LICENSE

The Requires

 

by Avatar ojhaujjwal

zf2 module zendframework