0

I have the a modular zend application which has the following modules, controllers and actions

Default Module
        Index Controller
        actions : index,login,logout
    Site Controller
        actions : index,cars,trains
Member Module
    Index Controller
        actions : index,login,logout
    Account Controller
        actions : index,profile,password
Admin Module
    Index Controller
        actions : index,login,logout
    Configuration Controller
        actions : index,pages,users

Now In my Zend Acl Plugin I am adding the modules and controllers as resources using the following code

<?php
$acl = new Zend_Acl();
$acl->add(new Zend_Acl_Resource('index')); //for default module
$acl->add(new Zend_Acl_Resource('site')); //for default module

$acl->add(new Zend_Acl_Resource('admin'));
$acl->add(new Zend_Acl_Resource('admin:configuration'),'admin');
$acl->add(new Zend_Acl_Resource('admin:index'),'admin');

$acl->add(new Zend_Acl_Resource('member'));
$acl->add(new Zend_Acl_Resource('member:account'),'member');
$acl->add(new Zend_Acl_Resource('member:index'),'member');
?>

But this is giving the following fatal error: Fatal Error: Uncaught exception 'Zend_Acl_Exception' with message 'Resource 'default:index' not found'

Manish Jangir
  • 5,329
  • 4
  • 42
  • 75
  • How are you checking whether a user can access a resource? – Tim Fountain Sep 05 '13 at 13:44
  • I have added roles above the code. but this is code is giving error – Manish Jangir Sep 06 '13 at 04:22
  • The problem appears to be in the code that's checking permissions though, as it's looking for `default:index`, but your resource is just called `index`. So that code (which you've not included) is probably where the problem lies. – Tim Fountain Sep 06 '13 at 09:08

0 Answers0