coolcsn / CsnAuthorization

Authorization module for Zend Framework 2
BSD 3-Clause "New" or "Revised" License
13 stars 15 forks source link

Resource "all" not defined #16

Closed adarshkhatri closed 8 years ago

adarshkhatri commented 9 years ago

File: /Applications/XAMPP/xamppfiles/htdocs/skeleton/vendor/coolcsn/csn-authorization/src/CsnAuthorization/View/Helper/IsAllowed.php:37

As I understand this error means I m not allowed to view "csn-cms". However I m logged in as Admin nd still receiving this error.

My acl.global.php

'CsnCms\Controller\Index' => array( 'all' => 'guest', ),

'CsnCms\Controller\Article' => array( 'view' => 'guest', 'vote' => 'member', 'index' => 'admin', 'add' => 'admin', 'edit' => 'admin', 'delete'=> 'admin',
),

'CsnCms\Controller\Translation' => array( 'index' => 'admin', 'add' => 'admin', 'edit' => 'admin', 'delete'=> 'admin',
), 'CsnCms\Controller\Comment' => array( 'index' => 'member', 'add' => 'member', 'edit' => 'member',
'delete'=> 'member',
), 'CsnCms\Controller\Category' => array( 'index' => 'admin', 'add' => 'admin', 'edit' => 'admin', 'delete'=> 'admin',
), 'CsnFileManager\Controller\Index' => array( 'all' => 'member',
),

// for CMS articles 'all' => array( 'view' => 'guest',
), 'Public Resource' => array( 'view' => 'guest',
), 'Private Resource' => array( 'view' => 'member',
), 'Admin Resource' => array( 'view' => 'admin',
),

I can confirm its working well for all other.

Plez suggest.

marciodojr commented 8 years ago

It is better to remove all admin entries in the config file and add in the Acl class the rule $this->allow('admin', null); // admin you will have access to all resources

adarshkhatri commented 8 years ago

Thank you.