[Zope-Checkins] SVN: Zope/trunk/lib/python/AccessControl/ -
converted interface to z3 interface.
Yvo Schubbe
y.2005- at wcm-solutions.de
Sat Nov 5 03:09:13 EST 2005
Log message for revision 39903:
- converted interface to z3 interface.
Changed:
D Zope/trunk/lib/python/AccessControl/IUserFolder.py
UU Zope/trunk/lib/python/AccessControl/User.py
U Zope/trunk/lib/python/AccessControl/interfaces.py
UU Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py
-=-
Deleted: Zope/trunk/lib/python/AccessControl/IUserFolder.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/IUserFolder.py 2005-11-05 00:21:42 UTC (rev 39902)
+++ Zope/trunk/lib/python/AccessControl/IUserFolder.py 2005-11-05 08:09:11 UTC (rev 39903)
@@ -1,18 +0,0 @@
-class IStandardUserFolder:
- def getUser(self, name):
- """
- Returns the user object specified by name. If there is no
- user named 'name' in the user folder, return None.
- """
-
- def getUsers(self):
- """
- Returns a sequence of all user objects which reside in the user
- folder.
- """
-
- def getUserNames(self):
- """
- Returns a sequence of names of the users which reside in the user
- folder.
- """
Modified: Zope/trunk/lib/python/AccessControl/User.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/User.py 2005-11-05 00:21:42 UTC (rev 39902)
+++ Zope/trunk/lib/python/AccessControl/User.py 2005-11-05 08:09:11 UTC (rev 39903)
@@ -7,32 +7,38 @@
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
+# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""Access control package"""
+"""Access control package.
-__version__='$Revision: 1.182 $'[11:-2]
+$Id$
+"""
import os
+import re
+import socket
+from base64 import decodestring
-import Globals, socket, SpecialUsers,re
+import Globals
+from Acquisition import Implicit
+from App.Management import Navigation, Tabs
from Globals import DTMLFile, MessageDialog, Persistent, PersistentMapping
-from App.Management import Navigation, Tabs
-from Acquisition import Implicit
from OFS.SimpleItem import Item
-from base64 import decodestring
-from App.ImageFile import ImageFile
-from Role import RoleManager, DEFAULTMAXLISTUSERS
-from PermissionRole import _what_not_even_god_should_do, rolesForPermissionOn
-import AuthEncoding
-from AccessControl import getSecurityManager
from zExceptions import Unauthorized, BadRequest
-from AccessControl.SecurityManagement import newSecurityManager
-from AccessControl.SecurityManagement import noSecurityManager
-from AccessControl.ZopeSecurityPolicy import _noroles
+from zope.interface import implements
+import AuthEncoding
+import SpecialUsers
+from interfaces import IStandardUserFolder
+from PermissionRole import _what_not_even_god_should_do, rolesForPermissionOn
+from Role import RoleManager, DEFAULTMAXLISTUSERS
+from SecurityManagement import getSecurityManager
+from SecurityManagement import newSecurityManager
+from SecurityManagement import noSecurityManager
+from ZopeSecurityPolicy import _noroles
+
_marker=[]
class BasicUser(Implicit):
@@ -978,7 +984,7 @@
def _setId(self, id):
if id != self.id:
- raise Globals.MessageDialog(
+ raise MessageDialog(
title='Invalid Id',
message='Cannot change the id of a UserFolder',
action ='./manage_main',)
@@ -1001,7 +1007,9 @@
""" returns true if domain auth mode is set to true"""
return getattr(self, '_domain_auth_mode', None)
+
class UserFolder(BasicUserFolder):
+
"""Standard UserFolder object
A UserFolder holds User objects which contain information
@@ -1009,6 +1017,8 @@
UserFolders function chiefly to control access by authenticating
users and binding them to a collection of roles."""
+ implements(IStandardUserFolder)
+
meta_type='User Folder'
id ='acl_users'
title ='User Folder'
@@ -1090,10 +1100,6 @@
Globals.default__class_init__(UserFolder)
-
-
-
-
def manage_addUserFolder(self,dtself=None,REQUEST=None,**ignored):
""" """
f=UserFolder()
@@ -1122,7 +1128,6 @@
host_match=re.compile(r'(([\_0-9a-zA-Z\-]*\.)*[0-9a-zA-Z\-]*)').match
-
def domainSpecMatch(spec, request):
host=''
addr=''
Property changes on: Zope/trunk/lib/python/AccessControl/User.py
___________________________________________________________________
Name: cvs2svn:cvs-rev
- 1.182
Name: svn:keywords
+ Id
Modified: Zope/trunk/lib/python/AccessControl/interfaces.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/interfaces.py 2005-11-05 00:21:42 UTC (rev 39902)
+++ Zope/trunk/lib/python/AccessControl/interfaces.py 2005-11-05 08:09:11 UTC (rev 39903)
@@ -263,3 +263,20 @@
def possible_permissions():
"""
"""
+
+
+class IStandardUserFolder(Interface):
+
+ def getUser(name):
+ """Get the user object specified by name.
+
+ If there is no user named 'name' in the user folder, return None.
+ """
+
+ def getUsers():
+ """Get a sequence of all user objects which reside in the user folder.
+ """
+
+ def getUserNames():
+ """Get a sequence of names of the users which reside in the user folder.
+ """
Modified: Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py
===================================================================
--- Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py 2005-11-05 00:21:42 UTC (rev 39902)
+++ Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py 2005-11-05 08:09:11 UTC (rev 39903)
@@ -7,24 +7,24 @@
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
+# FOR A PARTICULAR PURPOSE.
#
##############################################################################
-"""User folder tests
+"""User folder tests.
+
+$Id$
"""
-__rcs_id__='$Id$'
-__version__='$Revision: 1.10 $'[11:-2]
+import unittest
+import Testing
+import Zope2
+Zope2.startup()
-import os, sys, base64, unittest
+import os, sys, base64
+import transaction
from Testing.makerequest import makerequest
-import transaction
-
-import Zope2
-Zope2.startup()
-
from AccessControl import Unauthorized
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
@@ -65,6 +65,13 @@
user = user.__of__(self.uf)
newSecurityManager(None, user)
+ def test_z3interfaces(self):
+ from AccessControl.interfaces import IStandardUserFolder
+ from AccessControl.User import UserFolder
+ from zope.interface.verify import verifyClass
+
+ verifyClass(IStandardUserFolder, UserFolder)
+
def testGetUser(self):
self.failIfEqual(self.uf.getUser('user1'), None)
@@ -239,6 +246,7 @@
self.failUnless(uf._isPasswordEncrypted(user.__))
self.failUnless(pw_validate(user.__, PASSWORD))
+
class UserTests(unittest.TestCase):
def testGetUserName(self):
Property changes on: Zope/trunk/lib/python/AccessControl/tests/testUserFolder.py
___________________________________________________________________
Name: cvs2svn:cvs-rev
- 1.10
More information about the Zope-Checkins
mailing list