Re: Closing a particular section of a Pyramid site

2013-01-15 Thread Jonathan Vanasco
I let the load balancers / web servers handle this. Entering "maintenance mode" just creates a "downtime" file... `touch /webserver/controls/downtime` Leaving maintenance removes it. My nginx config handles app requests differently based on the presence of these files. On Tuesday, January

Re: Closing a particular section of a Pyramid site

2013-01-15 Thread Michael Merickel
I would try to think about this as "some button on my site is modifying the ACL for the /personal-data resource". It is easy to create dynamic ACLs which can query your data store to determine if something is enabled or not. From there the ACL controls who has access with little effort on your part

Re: Closing a particular section of a Pyramid site

2013-01-15 Thread Chris McDonough
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 (close

Re: Closing a particular section of a Pyramid site

2013-01-15 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Writing a tween makes sense...at least of the conceptual point of view :-) Thanks Andreas 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 t

Re: Closing a particular section of a Pyramid site

2013-01-15 Thread Wyatt Baldwin
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

Re: Closing a particular section of a Pyramid site

2013-01-15 Thread Arndt Droullier
You could use view predicates to add custom checks before views are called. If you use cached configuration values the overhead should be reduced to a minimum. see predicates or custom_predicates http://docs.pylonsproject.org/projects/pyramid/en/latest/api/config.html#pyramid.config.Configurator.a

Closing a particular section of a Pyramid site

2013-01-15 Thread Andreas Jung
-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 i