app/soc/views/helper/access.py
changeset 1528 abbdf42ab322
parent 1525 fe906cdbf0e9
child 1529 0800753ebc6a
--- a/app/soc/views/helper/access.py	Thu Feb 26 16:58:45 2009 +0000
+++ b/app/soc/views/helper/access.py	Thu Feb 26 16:59:24 2009 +0000
@@ -233,6 +233,7 @@
   #: the depths of various scopes to other scopes
   # the 0 entries are not used, and are for clarity purposes only
   SCOPE_DEPTH = {
+      'site': None,
       'sponsor': (sponsor_logic, {'sponsor': 0}),
       'program': (program_logic, {'sponsor': 1, 'program': 0}),
       'org': (org_logic, {'sponsor': 2, 'program': 1, 'org': 0}),
@@ -730,7 +731,11 @@
     """
 
     prefix = django_args['prefix']
-    scope_logic, depths = self.SCOPE_DEPTH.get(prefix, (None, {}))
+    if self.SCOPE_DEPTH.get(prefix):
+      scope_logic, depths = self.SCOPE_DEPTH[prefix]
+    else:
+      return self.checkHasActiveRole(django_args, logic)
+
     depth = depths.get(target_scope, 0)
 
     # nothing to do