Index: /main/waeup.sirp/trunk/src/waeup/sirp/permissions.py
===================================================================
--- /main/waeup.sirp/trunk/src/waeup/sirp/permissions.py	(revision 6143)
+++ /main/waeup.sirp/trunk/src/waeup/sirp/permissions.py	(revision 6144)
@@ -1,4 +1,5 @@
 import grok
-from zc.sourcefactory.basic import BasicSourceFactory
+from zope.interface import Interface
+from waeup.sirp.interfaces import ILocalRolesAssignable
 
 class Public(grok.Permission):
@@ -71,8 +72,43 @@
     return sorted(result.keys())
 
-class RoleSource(BasicSourceFactory):
-    def getValues(self):
-        return getRoles()
-    def getTitle(self, value):
-        if isinstance(value, basestring):
-            return value.split('.', 2)[1]
+class LocalRolesAssignable(grok.Adapter):
+    """Default implementation for `ILocalRolesAssignable`.
+
+    This adapter returns a list for dictionaries for objects for which
+    we want to know the roles assignable to them locally.
+
+    The returned dicts contain a ``name`` and a ``title`` entry which
+    give a role (``name``) and a description, for which kind of users
+    the permission is meant to be used (``title``).
+
+    Having this adapter registered we make sure, that for each normal
+    object we get a valid `ILocalRolesAssignable` adapter.
+
+    Objects that want to offer certain local roles, can do so by
+    setting a (preferably class-) attribute to a list of dictionaries.
+
+    You can also define different adapters for different contexts to
+    have different role lookup mechanisms become available. But in
+    normal cases it should be sufficient to use this basic adapter.
+    """
+    grok.context(Interface)
+    grok.provides(ILocalRolesAssignable)
+
+    _roles = []
+
+    def __init__(self, context):
+        self.context = context
+        self._roles = getattr(context, 'local_roles', self._roles)
+        return
+
+    def __call__(self):
+        """Get a list of dictionaries containing ``names`` (the roles to
+        assign) and ``titles`` (some description of the type of user
+        to assign each role to).
+        """
+        return self._roles
+
+    def roles(self):
+        """Return a list of roles assignable to the context object.
+        """
+        return [x['name'] for x in self._roles]
