Add a getMemberships method to logic/rights.py
This will be used by the document picker ACL checks.
Patch by: Sverre Rabbelier
--- a/app/soc/logic/rights.py Fri Feb 13 19:22:34 2009 +0000
+++ b/app/soc/logic/rights.py Fri Feb 13 21:51:16 2009 +0000
@@ -22,6 +22,8 @@
]
+from soc.logic import dicts
+
class Checker(object):
"""Checker class that maps from prefix and status to membership.
"""
@@ -89,3 +91,9 @@
return ['anyone']
return self.rights[status]
+
+ def getMemberships(self):
+ """Returns all memberships for the configured prefix.
+ """
+
+ return dicts.merge(self.rights, {'user': ['user'], 'public': ['anyone']})