If I have the following in my __acl__:
[ (Allow, Everyone, 'view') ]

And if I set a default permission to 'view', this means that every
view can be accessed by Everyone except if a specific permission is
used. Am I right ?
In this case, the context=Forbidden view is intended to be accessible
by Everyone.
Though, trying to load any page raises an error.

What I was trying to do, which might seem stupid, was to allow access
to any view only Authenticated users except for the Forbidden view
which would be accessible for anyone.
To do this, I can also set a specific permission for limited access on every
view except the Forbidden one.

I agree that this discussion should go to pylons-discuss. But I
thought I had found a bug. Unfortunately, I'm too new to pyramid to be
sure.

Thanks.
Pierre

On Wed, Jul 13, 2011 at 9:35 PM, Mariano Mara <mariano.m...@gmail.com> wrote:
> On 13.07.11 21:20, Pierre GIRAUD wrote:
>> It looks like I cannot set a permission to a view added for the
>> Forbidden context.
>>
>> config.add_view('tutorial.login.login',
>>                         renderer='tutorial:templates/login.pt',
>>                         context='pyramid.exceptions.Forbidden',
>>                         permission='view')
>>
>> Even if the corresponding __acl__ is :
>> [ (Allow, Everyone, 'view') ]
>>
>> I get the following kind of error:
>> HTTPForbidden: Unauthorized: <function login at 0x951133c> failed
>> permission check
>>
>> I could easily live without any permission for that view, but I get
>> the same error if I set a default_permission at the config level which
>> is a bit more annoying.
>>
>> Did I do something wrong ?
>> Thanks,
>>
>> Pierre
>>
>
> What's the point to set a permission on a Forbidden view? You land in it
> because you don't have access to a previous resource, that's the one you
> should protect with a permission. Can you elaborate a bit more?
>
> Mariano
>
> BTW, I thinks this question belongs to pylons-discuss.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "pylons-devel" group.
> To post to this group, send email to pylons-devel@googlegroups.com.
> To unsubscribe from this group, send email to 
> pylons-devel+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/pylons-devel?hl=en.
>
>



-- 
-------------------------------------------------------------
  | Pierre GIRAUD
  | http://pierrelebricoleur.blogspot.com
  | http://www.flickr.com/photos/pierregiraud
-------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-devel" group.
To post to this group, send email to pylons-devel@googlegroups.com.
To unsubscribe from this group, send email to 
pylons-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/pylons-devel?hl=en.

Reply via email to