Restore context in deny() page
Now that we know when the sidebar is doing the access checks we can
safely construct a new context in deny (without having to worry that
it will try to do more access checks that result in deny, which will
call for a new context... etc).
Patch by: Sverre Rabbelier
--- a/app/soc/views/helper/access.py Fri Jan 23 16:53:19 2009 +0000
+++ b/app/soc/views/helper/access.py Fri Jan 23 16:54:46 2009 +0000
@@ -126,7 +126,14 @@
Raises:
always raises AccessViolationResponse if called
"""
- context = {}
+
+ import soc.views.helper.responses
+
+ if kwargs.get('SIDEBAR_CALLING', False):
+ context = {}
+ else:
+ context = soc.views.helper.responses.getUniversalContext(request)
+
context['title'] = 'Access denied'
raise out_of_band.AccessViolation(DEF_PAGE_DENIED_MSG, context=context)