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 5992673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:33:59+00:00 2026-05-22T23:33:59+00:00

I am checking an ACL in the pre-dispatch method of an ACL Action Helper.

  • 0

I am checking an ACL in the pre-dispatch method of an ACL Action Helper. If the action is-allowed, the controller/action should continue as per normal. (No problems there). If it’s NOT allowed, however, I would like to:

  • leave the requsted URI in the browser
  • skip executing the requested action method
  • generate an ‘access denied’ message

At first I thought I would just call _forward() in the Action Helper, but I can’t since it’s a protected method. The View Renderer Action Helper says that gotoSimple is like _forward, however it still performs the full http redirect (and thus changes the URI in the browser).

I could try calling setScriptPath() on View, then Render(), however this would not prevent the requested controller/action from firing. I think there’s probably a straightforward answer to this, but it’s beyond my level of experience!

Any assistance appreciated!

  • 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-22T23:33:59+00:00Added an answer on May 22, 2026 at 11:33 pm

    This is most easily solved by simply throwing a Zend_Controller_Action_Exception, preferably with code 401 (Unauthorized).

    This will be caught by the error handler plugin and forwarded to the Error controller.

    You can then check for this error code and handle it appropriately. This is in my error controller

    if ($errors->exception->getCode() == 401) {
        $this->getResponse()->setHttpResponseCode(401);
        return $this->_forward('unauthorized');
    }
    

    The “unauthorized” action just displays a view but you could do more with it (log an error for example)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm checking out the Delphi 2009 Trial, but run into problems with the generics
Is there a way to enforce constraint checking in MSSQL only when inserting new
When checking if an event handler is null, is this done on a per-thread
I'm checking out amazon simpledb documentation. They mention only server side languages. Is there
Checking the Xerces-C++ webpage , I saw there are two major branches of the
Just checking, but it appears D3D9's DrawPrimitiveUP / any method of drawing WITHOUT a
Checking the HTML source of a question I see for instance: <a id=comments-link-xxxxx class=comments-link>add
I was checking out Intel's whatif site and their Transactional Memory compiler (each thread
I am just checking out F#, so apologies if this is a silly question,
I'm checking for existing of a row in in_fmd, and the ISBN I look

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.