2017 © Pedro Peláez
 

library zf2-simple-acl

Simple acl module. Provide possibilities to restrict ROUTES. Provide smart redirection according on path/module where user requested restricted resource. It is can be used for restricting few modules with on ACL library.

image

spalax/zf2-simple-acl

Simple acl module. Provide possibilities to restrict ROUTES. Provide smart redirection according on path/module where user requested restricted resource. It is can be used for restricting few modules with on ACL library.

  • Friday, January 31, 2014
  • by Spalax
  • Repository
  • 1 Watchers
  • 0 Stars
  • 92 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

ZF2 Simple Acl

Simple acl module., (*1)

Restrict ROUTES

Only one thing you need to start is to define routes which you want to restrict and the strategy which you would like to use for other not defined routes. Strategy might be 'permissive' or 'strict'. If value 'permissive' it will mean "allow all from all" so then you will have to restrict all resources which you want to be restricted. If value 'strict' it is will mean "deny all from all" so then you will have to allow every resource which you want to be available, (*2)

'restriction_strategy' => 'permissive',

'routes' => array(
  'main' => array(true)
)

Smart redirection

Provide smart redirection according on path/module where user requested restricted resource. It is can be used for restricting few modules with on ACL library., (*3)

'redirect_route' => array('/frontend.*?/'=>'frontend/user/login',
                          '/backend.*?/'=>'backend/user/login')

It is very usefull if you have authorization on your frontend and backend modules, and you would like to redirect user who requested backend resource to the backend/user/login route and users who requested frontend restricted resource to the frontend/user/login., (*4)

Recognizers

It is very simple ability to authorize user by some token. Now supports authorization only thru token defined in COOKIE. I've added this feature only because from time to time i need user role which can acces to the special resources but without real authorization thru login form. In my example it was a cron script., (*5)

wget http://$1/generate/sitemap --no-cookies --header "Cookie: cron=a23b4cdg76fb38a5d48b83e22f0e79df" -o /dev/null -O /tmp/sitemap.generated

you should specify recognizer:, (*6)

'recognizers' => array('cron'),

and role :, (*7)

  'roles' => array(array('name'=>'cron',
                         'id'=>2,
                         'data' => array(
                             'type'=>'cron',
                             // It is authorization token, value will be compared with
                             // token inside $_COOKIE['cron'] and will decide that this is
                             // cron role.
                             'token'=>'a23b4cdg76fb38a5d48b83e22f0e79df'
  )))

The Versions

31/01 2014

dev-master

9999999-dev

Simple acl module. Provide possibilities to restrict ROUTES. Provide smart redirection according on path/module where user requested restricted resource. It is can be used for restricting few modules with on ACL library.

  Sources   Download

MIT

The Requires

 

by Mylotskyi Oleksii

acl

11/12 2013

0.0.2

0.0.2.0

Simple acl module. Provide possibilities to restrict ROUTES. Provide smart redirection according on path/module where user requested restricted resource. It is can be used for restricting few modules with on ACL library.

  Sources   Download

MIT

The Requires

 

by Mylotskyi Oleksii

acl

21/11 2013

0.0.1

0.0.1.0

Simple acl module. Provide possibilities to restrict ROUTES. Provide smart redirection according on path/module where user requested restricted resource. It is can be used for restricting few modules with on ACL library.

  Sources   Download

MIT

The Requires

 

by Mylotskyi Oleksii

acl

13/11 2013

dev-restricted_route_redirection

dev-restricted_route_redirection

Simple acl module. Provide possibilities to restrict ROUTES. Provide smart redirection according on path/module where user requested restricted resource. It is can be used for restricting few modules with on ACL library.

  Sources   Download

MIT

The Requires

 

by Mylotskyi Oleksii

acl