Specify how to walk the scope up to another scope
authorSverre Rabbelier <srabbelier@gmail.com>
Sat, 21 Feb 2009 20:14:51 +0000
changeset 1442 8eec34007e80
parent 1441 e633906ed88d
child 1443 8ce8314d1c8f
Specify how to walk the scope up to another scope This will be used by document ACL later. Patch by: Sverre Rabbelier
app/soc/views/helper/access.py
--- a/app/soc/views/helper/access.py	Sat Feb 21 20:14:19 2009 +0000
+++ b/app/soc/views/helper/access.py	Sat Feb 21 20:14:51 2009 +0000
@@ -225,6 +225,14 @@
     'user_self': ('checkIsUserSelf', 'scope_path'),
     }
 
+  #: the depths of various scopes to other scopes
+  # the 0 entries are not used, and are for clarity purposes only
+  SCOPE_DEPTH = {
+      'sponsor': (sponsor_logic, {'sponsor': 0}),
+      'program': (program_logic, {'sponsor': 1, 'program': 0}),
+      'org': (org_logic, {'sponsor': 2, 'program': 1, 'org': 0}),
+      }
+
   def __init__(self, params):
     """Adopts base.rights as rights if base is set.
     """