--- a/src/pyams_security/schema.py Fri Apr 17 14:55:45 2015 +0200
+++ b/src/pyams_security/schema.py Mon Apr 20 09:50:51 2015 +0200
@@ -16,11 +16,39 @@
# import standard library
# import interfaces
-from zope.schema.interfaces import ITextLine, ISet
+from zope.schema.interfaces import ITextLine, IChoice, ISet
# import packages
from zope.interface import implementer, Interface
-from zope.schema import TextLine, Set
+from zope.schema import TextLine, Choice, Set
+
+
+class IPermissionField(IChoice):
+ """Permission field interface"""
+
+
+@implementer(IPermissionField)
+class PermissionField(Choice):
+ """Permission field"""
+
+ def __init__(self, **kwargs):
+ if 'vocabulary' in kwargs:
+ del kwargs['vocabulary']
+ super(PermissionField, self).__init__(vocabulary='PyAMS permissions', **kwargs)
+
+
+class IPermissionsSetField(ISet):
+ """Permissions set field interface"""
+
+
+@implementer(IPermissionsSetField)
+class PermissionsSetField(Set):
+ """Permissions set field"""
+
+ def __init__(self, **kwargs):
+ if 'value_type'in kwargs:
+ del kwargs['value_type']
+ super(PermissionsSetField, self).__init__(value_type=PermissionField(), **kwargs)
class IRoleField(Interface):