On Sun, Dec 4, 2011 at 9:11 PM, Mike Orr <[email protected]> wrote:
> My main hesitation with using traversal is, how do I prevent views
> from being accessed willy-nilly from any resource? The 'starter'
> scaffold defines a static view and a home page view. Are these by
> default accessible only as "/static" and "/"? Or if there's a resource
> "/a/b/c/", would they also be accessible as "/a/bc/static" and
> "/a/b/c"? I like tight restrictions, so that a resource can only
> access a few certain views rather than any view. Do I  have to
> verbosely specify that for every resource type? Or can I be reassured
> that a view won't be accessible from a resource type unless I
> configure something?
>

I typically specify a type for the context:

@view_config(name='edit', context='BlogPost', permission='edit')
def edit_blogpost_view(context, request):
    etc....

That view will only get called if the resource is a BlogPost and the
view name is 'edit'.

Chris


> --
> Mike Orr <[email protected]>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "pylons-discuss" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/pylons-discuss?hl=en.
>

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

Reply via email to