--- a/etwist/server.py Tue Apr 28 19:14:37 2009 +0200
+++ b/etwist/server.py Wed Apr 29 10:11:53 2009 +0200
@@ -155,6 +155,14 @@
else:
return threads.deferToThread(self.render_request, request)
+ def _host_prefixed_base_url(self, base_url):
+ scheme, netloc, url, query, fragment = urlsplit(baseurl)
+ if '.' in netloc:
+ netloc = '.'.join(host.split('.')[:1] + netloc.split('.')[1:])
+ baseurl = urlunsplit((scheme, netloc, url, query, fragment))
+ self.warning('base_url is %s for this request', baseurl)
+ return base_url
+
def render_request(self, request):
origpath = request.path
host = request.host
@@ -169,11 +177,7 @@
https = False
baseurl = self.base_url
if self.config['use-request-subdomain']:
- scheme, netloc, url, query, fragment = urlsplit(baseurl)
- if '.' in netloc:
- netloc = '.'.join(host.split('.')[:1] + netloc.split('.')[1:])
- baseurl = urlunsplit((scheme, netloc, url, query, fragment))
- self.warning('base_url is %s for this request', baseurl)
+ base_url = self._host_prefixed_base_url(base_url)
req = CubicWebTwistedRequestAdapter(request, self.appli.vreg, https, baseurl)
if req.authmode == 'http':
# activate realm-based auth
--- a/web/views/startup.py Tue Apr 28 19:14:37 2009 +0200
+++ b/web/views/startup.py Wed Apr 29 10:11:53 2009 +0200
@@ -10,9 +10,9 @@
from logilab.common.textutils import unormalize
from logilab.mtconverter import html_escape
-from cubicweb.common.uilib import ureport_as_html, unormalize, ajax_replace_url
-from cubicweb.common.view import StartupView
-from cubicweb.common.selectors import match_user_group
+from cubicweb.common.uilib import ureport_as_html, ajax_replace_url
+from cubicweb.view import StartupView
+from cubicweb.selectors import match_user_groups
from cubicweb.web.httpcache import EtagHTTPCacheManager
from cubicweb.web.views.management import SecurityViewMixIn
from copy import deepcopy
@@ -192,8 +192,7 @@
class ManagerSchemaPermissionsView(StartupView, SecurityViewMixIn):
id = 'schema_security'
- require_groups = ('managers',)
- __selectors__ = StartupView.__selectors__ + (match_user_group,)
+ __selectors__ = StartupView.__selectors__ + (match_user_groups('managers'),)
def call(self, display_relations=True,
skiprels=('is', 'is_instance_of', 'identity', 'owned_by', 'created_by')):