Added constants for system users login name and id
authorThierry Florac <thierry.florac@onf.fr>
Mon, 11 Sep 2017 13:54:12 +0200
changeset 91 7da0d3862d36
parent 90 d58453809379
child 92 4489af75f076
Added constants for system users login name and id
src/pyams_security/interfaces/__init__.py
--- a/src/pyams_security/interfaces/__init__.py	Mon Sep 11 13:53:16 2017 +0200
+++ b/src/pyams_security/interfaces/__init__.py	Mon Sep 11 13:54:12 2017 +0200
@@ -33,11 +33,19 @@
 from pyams_security import _
 
 
+SYSTEM_PREFIX = 'system'
+
+ADMIN_USER_LOGIN = 'admin'
+ADMIN_USER_ID = '{0}:{1}'.format(SYSTEM_PREFIX, ADMIN_USER_LOGIN)
+
+INTERNAL_USER_LOGIN = 'internal'
+INTERNAL_USER_ID = '{0}:{1}'.format(SYSTEM_PREFIX, INTERNAL_USER_LOGIN)
+
+
 #
 # Permissions constants and interfaces
 #
 
-
 class IPermission(Interface):
     """Permission utility class"""
 
@@ -183,7 +191,8 @@
 
     login = TextLine(title=_("Admin. login"))
 
-    password = EncodedPassword(title=_("Admin. password"))
+    password = EncodedPassword(title=_("Admin. password"),
+                               required=False)
 
 
 class IDirectoryInfo(Interface):
@@ -356,7 +365,7 @@
 
     password = EncodedPassword(title=_("Password"),
                                description=_("Password must be at least 8 characters long, and contain at least "
-                                             "three kins of characters between lowercase letters, uppercase "
+                                             "three kinds of characters between lowercase letters, uppercase "
                                              "letters, numbers and special characters"),
                                min_length=8,
                                required=True)