On Tue, 2013-01-15 at 18:11 +0100, Andreas Jung wrote:
> Writing a tween makes sense...at least of the conceptual point of view :-)
> 
> Thanks
> Andreas

I'll also note that the Pyramid ACLAuthorizationPolicy allows for use of
a "Deny" action.  If you have no more granular assertions higher (closer
to the leafs) in the tree, and you're using ACLs, you can do something
like add the following ACL to /personal_data:

(Deny, group.Users, ALL_PERMISSIONS)

If /personal_data/foo has an ACL that explicitly allows the user or one
of the user's groups for some permission, this won't help, however.

- C


> 
> Wyatt Baldwin wrote:
> > On Tuesday, January 15, 2013 4:00:09 AM UTC-8, Andreas Jung wrote:
> > 
> > -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
> > 
> > Let's assume that we have a Pyramid site with several functional 
> > sections. As part of maintenance operations you want to disable a
> > parts of the site e.g. by disallowing all views under a certain
> > certain route/path like /personal-data or so. My vision is having a
> > central place in my application where I can enable/disable the
> > various parts of the application with a click and this should have an
> > immediate effect without reconfiguration of app-servers, reverse
> > proxies etc...any ideas how to do this best with Pyramid?
> > 
> > 
> > You could implement something like this with a tween. Just have a
> > list of URL paths somewhere (in memory or a database or Redis or
> > whatever is suitable for your purposes) that you want to disable. The
> > tween would simply check PATH_INFO against the list and return a
> > standard 503 response before the request ever reaches your app.
> > 
> > I'm suggesting a tween (as opposed to WSGI middleware) because a
> > tween has access to the Pyramid environment, which can be used to
> > generate a page that lists all of your app's URLs with check boxes
> > for disabling individual pages or subsections.
> > 
> > -- You received this message because you are subscribed to the
> > Google Groups "pylons-discuss" group. To view this discussion on the
> > web visit 
> > https://groups.google.com/d/msg/pylons-discuss/-/ZE3b-ZeoruQJ. 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