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

  • SEARCH
  • Home
  • 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 6112461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:44:52+00:00 2026-05-23T14:44:52+00:00

I am trying to learn to create navigation with Zend_Acl. But the navigation only

  • 0

I am trying to learn to create navigation with Zend_Acl.
But the navigation only displays for admin and no one else.

I have read through my code and I tried to trace the code that comes with ZendFramework. But I am stuck and I can’t figure out what I am doing wrong.

Here is my acl class:

class Application_Model_LibraryACL extends Zend_Acl
{
    public function __construct()
    { 
            $this->add(new Zend_Acl_Resource( 'guestbook' ) );
            $this->add( new Zend_Acl_Resource( 'index' ) );

            $this->add(new Zend_Acl_Resource( 'error' ) );
            $this->add(new Zend_Acl_Resource( 'authentication' ) );
            $this->add(new Zend_Acl_Resource( 'login' ), 'authentication' );
            $this->add(new Zend_Acl_Resource( 'logout' ), 'authentication' );

            $this->addRole( new Zend_Acl_Role( 'guest' ) );
            $this->addRole( new Zend_Acl_Role( 'member' ), 'guest' );
            $this->addRole( new Zend_Acl_Role( 'admin' ), 'member' );

            $this->allow( 'guest', 'error', 'error' );
            $this->allow( 'guest', 'index', 'index' );
            $this->allow( 'guest', 'authentication', array( 'login', 'logout' ) );
            $this->allow( 'member', 'guestbook', 'sign' );
            $this->allow( 'admin' );
    } 
}

Here is the xml file that defines the navigation:

<?xml version="1.0" encoding="utf-8"?>
<config>
    <nav>
            <home>
                    <label>Home</label>
                    <controller>index</controller>
                    <action>index</action>
                    <resource>index</resource>
            </home>

            <logout>
                    <label>Logout</label>
                    <controller>authentication</controller>
                    <action>logout</action>
                    <resource>logout</resource>
            </logout>

            <login>
                    <label>Login</label>
                    <controller>authentication</controller>
                    <action>login</action>
                    <resource>login</resource>
            </login>

            <guestbook>
                    <label>Guestbook</label>
                    <resource>guestbook</resource>
                    <uri></uri>
                    <pages>
                            <list>
                                    <label>List</label>
                                    <controller>guestbook</controller>
                                    <action>index</action>
                                    <resource>guestbook</resource>
                            </list>
                            <sign>
                                    <label>Sign</label>
                                    <controller>guestbook</controller>
                                    <action>sign</action>
                                    <resource>guestbook</resource>
                            </sign>
                    </pages>
            </guestbook>


    </nav>

And here is the code in the bootstrap file that sets up the navigation:

$navContainerConfig = new Zend_Config_Xml( APPLICATION_PATH . '/configs/navigation.xml', 'nav' );
$navContainer = new Zend_Navigation( $navContainerConfig );
$view->navigation( $navContainer )->setAcl( $this->acl )->setRole( Zend_Registry::get( 'role' ) );

$this->acl holds the acl object and zend registry holds the role of the logged in user.

please ask any question you might have. I have been completely stuck for over 3 days.

  • 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-23T14:44:53+00:00Added an answer on May 23, 2026 at 2:44 pm

    What I see and concerns me are two things.

    First is a resource named “guestbook” is used three times. I don’t think this is your problem but you should fix that.

    Second, and your problem, the third argument in allow are $privileges. I’m not certain about what I’m saying now but navigation does not require privileges. Most certainly not the ones you’ve provided, though.

    So, try just this:

    $this->allow( 'guest', 'error' );
    $this->allow( 'guest', 'index' );
    $this->allow( 'guest', 'authentication');
    $this->allow( 'member', 'guestbook' );
    $this->allow( 'admin' );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In trying to learn how to create objects in ActionScript, I have had no
I have been trying to learn about resources and styles, I want to create
I am trying to learn how to create tags in PHP/MySQL. Does anyone know
I'm trying to learn how to create custom controls, toolbars. Using .NET Reflector, I've
I am new to C# and trying to learn how to create windows form
I'm trying to learn JavaFX and maybe create a few learner games. I always
I am trying to learn & create Visual Studio templates and as per this
I’m trying to learn Haskell and I was trying to create a function that
I'm trying to learn bash string handling. How do I create a bash script
I'm trying to learn how to use lift. I can create project skeleton by

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.