Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6348275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:23:17+00:00 2026-05-24T21:23:17+00:00

Zend’s Acl allows the resource to be created in controller only But, the controllers

  • 0

Zend’s Acl allows the resource to be created in controller only

But, the controllers might be on any module not just only the default module. So, I read some article off the internet, I found one and tried this:

$acl -> addResource(new Zend_Acl_Resource("admin"));
$acl -> addResource(new Zend_Acl_Resource("admin:page"), "admin");
$acl -> addResource(new Zend_Acl_Resource("admin:posts"), "admin");

But, still, when i browse to the respective pages, I get errors regarding resouce page not found, or posts not found.

How to setup Module Specific ACL Resource?

Update:

$acl -> addrole(new Zend_Acl_Role('guest'))
    -> addrole(new Zend_Acl_ROle('admin'), 'admin');

$acl -> addResource(new Zend_Acl_Resource("page")); //controller with same name in admin module exists

$acl -> addResource(new Zend_Acl_Resource("admin"));
$acl -> addResource(new Zend_Acl_Resource("admin:page"), "admin");
$acl -> addResource(new Zend_Acl_Resource("admin:posts"), "admin");

$acl -> deny(null, null);
$acl -> allow('user', 'page', 'view');
$acl -> allow('admin', null);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T21:23:18+00:00Added an answer on May 24, 2026 at 9:23 pm

    I’m guessing the code you posted was some sort of pseudo code, as it wasn’t valid. Still, this answer should work perfectly fine as is.

    $acl->addrole(new Zend_Acl_Role('guest'))
        ->addrole(new Zend_Acl_Role('admin'), 'guest');
    
    $acl->addResource(new Zend_Acl_Resource("page"));
    $acl->addResource(new Zend_Acl_Resource("admin"));
    $acl->addResource(new Zend_Acl_Resource("admin:page"), "admin");
    $acl->addResource(new Zend_Acl_Resource("admin:posts"), "admin");
    
    $acl->deny();
    $acl->allow('guest', 'page', 'view');
    $acl->allow('admin');
    
    // Lets run some quick tests...
    var_dump($acl->isAllowed('guest', 'page', 'view')); // true
    var_dump($acl->isAllowed('guest', 'page', 'edit')); // false
    var_dump($acl->isAllowed('guest', 'admin:page', 'view')); // false
    
    var_dump($acl->isAllowed('admin', 'page', 'view')); // true
    var_dump($acl->isAllowed('admin', 'page', 'edit')); // false
    var_dump($acl->isAllowed('admin', 'admin:page', 'view')); // true
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Zend_Form:: When should be form created in view and not in controller? option 1
in Zend FW: file_exists('xx/xxx/xxxx.jpg'); returned 1, but xx/xxx/xxxx.jpg is not file or directory. it's
Zend Form is not my friend today! This works :- Controller:- public function indexAction()
Zend has Zend_Db but it's not a full ORM. I already have sections of
The Zend Framework coding standard mentions the following: For files that contain only PHP
Using Zend Framework, I've created a Model to insert a record into a database.
I am using the Zend Framework. I have a controller named 'UserController' that has
Zend_Controller_Plugin_ErrorHandler always forwards to ErrorController::errorAction() in the default module but i want it be
Zend_Form:: how remove all label from zend form? $title->removeDecorator('Label'); for one but for all
Does Zend Framework has native Couch DB support? I found only Zend_Couch by Matthew

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.