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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:52:26+00:00 2026-05-24T07:52:26+00:00

I have a browser view, with some utilities. Is mainly an utility view that

  • 0

I have a browser view, with some utilities. Is mainly an “utility view” that I traverse using old-style pt templates (that are inside skins folder). My browser/configure.zcml:

  <browser:page
      for="*"
      name="my_view"
      class=".myview.MyView"
      allowed_interface=".myview.IMyView"
      permission="my.permission"
      />

As you can see, it has a custom permission: this is needed because anonymous users can’t render this view and this permission is really specific to a certain situation in my portal.

I thought: I’m going to try to render the view in my template.pt: since I’ve already set a permission in browser/configure.zcml, when trying to render Plone itself is going to handle this for me. So I did in my template

    <span tal:define="my_view here/@@myview">
    </span>

So far, so good. A user without my.permission trying to get into /Plone/template.pt will fail. But Plone redirects to the login form, and I would prefer to raise a Forbidden exception instead. Something like:

    <span tal:define="my_view here/@@myview | here/raiseForbidden">
    </span>

…but, of course, this doesn’t work since the view rendering didn’t throw an error. (I know here/raiseForbidden doesn’t exist, it’s here/raiseUnauthorized that is usually used but the concept is the same)

My question is: is it possible to do it? Configuring my permission somewhere, or configuring some method in my view (like render or __call__), that when a user doesn’t have permission to render it, an exception like Forbidden is raised?

  • 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-24T07:52:27+00:00Added an answer on May 24, 2026 at 7:52 am

    Plone redirects to the login form because you raise Unauthorized. If you want different behaviour you’ll need to do something different.

    In this case, you could directly redirect the user to a new page with an error message tailored to the situation.

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

Sidebar

Related Questions

I have a function in a view that renders the xml in the browser,
I have a view that I am presenting modally. For some reason it animates
in my android application I have some buttons that launch the native browser to
I have some simple JavaScript that determines where a click happens within a browser
I have some javascripts that I am using in my files. But when we
Anyone have some sample code for an in-app browser that they would like to
Does anyone have some sample code demonstrating how to make a file browser view?
I have a view that for some reason displays the memory location of the
Using MVC3 Razor, I have a partial view with some text, two text boxes
I have a Browser Helper Object project in c# that (obviously) references shdocvw.dll. I

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.