Updated groups interfaces
authorThierry Florac <tflorac@ulthar.net>
Sat, 28 Feb 2015 15:22:21 +0100
changeset 3 1dca3f8a61e6
parent 2 94e76f8e9828
child 4 ec4cd04d4a8c
Updated groups interfaces
src/pyams_security/interfaces/__init__.py
--- a/src/pyams_security/interfaces/__init__.py	Mon Feb 23 17:55:05 2015 +0100
+++ b/src/pyams_security/interfaces/__init__.py	Sat Feb 28 15:22:21 2015 +0100
@@ -9,7 +9,6 @@
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
 # FOR A PARTICULAR PURPOSE.
 #
-from zope.interface.interfaces import IObjectEvent, ObjectEvent
 
 __docformat__ = 'restructuredtext'
 
@@ -21,6 +20,7 @@
 from pyams_skin.interfaces import IContentSearch
 from zope.annotation.interfaces import IAttributeAnnotatable
 from zope.container.interfaces import IContainer
+from zope.interface.interfaces import IObjectEvent, ObjectEvent
 from zope.location.interfaces import IContained
 
 # import packages
@@ -28,7 +28,7 @@
 from pyams_utils.schema import EncodedPassword
 from zope.container.constraints import contains, containers
 from zope.interface import implementer, Interface, Attribute, invariant, Invalid
-from zope.schema import TextLine, Text, Int, Bool, List, Tuple, Set, Dict, Choice, Datetime, Object
+from zope.schema import TextLine, Text, Int, Bool, List, Tuple, Set, Dict, Choice, Datetime
 
 from pyams_security import _
 
@@ -76,9 +76,9 @@
     title = TextLine(title="Principal name",
                      required=True)
 
-    groups = Set(title="Principal groups",
-                 description="IDs of principals to which this principal directly belongs",
-                 value_type=TextLine())
+    attributes = Dict(title="Principal groups",
+                      description="IDs of principals to which this principal directly belongs",
+                      value_type=TextLine())
 
 
 class ICredentials(Interface):
@@ -207,6 +207,10 @@
         """
 
 
+class IGroupsAwareDirectoryPlugin(Interface):
+    """Marker interface for plug-ins handling groups"""
+
+
 #
 # Social users interfaces
 #
@@ -459,7 +463,7 @@
 # Principals groups
 #
 
-class IGroupsFolderPlugin(IDirectorySearchPlugin):
+class IGroupsFolderPlugin(IDirectorySearchPlugin, IGroupsAwareDirectoryPlugin):
     """Principals groups folder plug-in"""
 
     contains('pyams_security.interfaces.ILocalGroup')