# HG changeset patch # User Thierry Florac # Date 1425133341 -3600 # Node ID 1dca3f8a61e61894bcfb19d2786fe98b2be176f8 # Parent 94e76f8e9828c0b53bd4992316f962e5fdfa74c0 Updated groups interfaces diff -r 94e76f8e9828 -r 1dca3f8a61e6 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')