--- a/app/soc/modules/core.py Fri Sep 18 19:34:30 2009 +0200
+++ b/app/soc/modules/core.py Fri Sep 18 19:55:03 2009 +0200
@@ -112,6 +112,7 @@
self.sidebar = []
self.per_request_cache = {}
self.in_request = False
+ self.rights = {}
##
## internal
@@ -205,6 +206,15 @@
return sorted(sidebar, key=lambda x: x.get('group'))
+ def getRightsChecker(self, prefix):
+ """Returns a rights checker for this site.
+ """
+
+ from soc.logic import rights as rights_logic
+
+ self.callService('registerRights', True)
+ return rights_logic.Checker(self.rights, prefix)
+
###
### Core control code
###
@@ -312,3 +322,9 @@
"""
self.sidebar.append(entry)
+
+ def registerRight(self, key, value):
+ """Registers the specified right.
+ """
+
+ self.rights[key] = value