[Zope3-checkins] CVS: Zope3/src/zope/app/browser/security/grants/tests - permissionservice.py:1.3 roleservice.py:1.3 test_principalpermissionview.py:1.6 test_principalroleview.py:1.6

Guido van Rossum guido@python.org
Mon, 3 Mar 2003 18:16:35 -0500


Update of /cvs-repository/Zope3/src/zope/app/browser/security/grants/tests
In directory cvs.zope.org:/tmp/cvs-serv7820/src/zope/app/browser/security/grants/tests

Modified Files:
	permissionservice.py roleservice.py 
	test_principalpermissionview.py test_principalroleview.py 
Log Message:
Merge from use-config-branch.  (A joint production by Jim, Tim and Guido.)

- Refactor the service creation and configuration code, making the UI
  for creating and configuring services much more pleasant.

- Add a new marker interface, IUseConfigurable, which is used to say
  that an object records dependencies between it and its
  configurations.  (This applies to other configurable objects besides
  services.)  Another marker interface, IAttributeUseConfigurable,
  says that these dependencies are stored as annotations.  And finally
  IUseConfiguration defines the actual interface for discussing these
  dependencies; implementing IUseConfigurable is a promise that such
  an adapter exists (and implementing IAttributeUseConfigurable is one
  way of making this promise come true :-).

- Add a new view tab for services, called "Configurations", which
  displays links to its configurations with summary information.  (Try
  it for the Events service, which has two configurations by default.)

- Add a new interface, ILocalService, which all local services must
  implement.  Also add ISimpleService, which extends ILocalService
  with IAttributeUseConfigurable.  All existing local service
  implementations implement this.

- Some miscellaneous cleanup (e.g. made the browser namespace the
  default namespace in zope/app/browser/services/configure.zcml).


=== Zope3/src/zope/app/browser/security/grants/tests/permissionservice.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/security/grants/tests/permissionservice.py:1.2	Wed Dec 25 09:12:35 2002
+++ Zope3/src/zope/app/browser/security/grants/tests/permissionservice.py	Mon Mar  3 18:16:04 2003
@@ -18,6 +18,7 @@
 
 from zope.app.interfaces.security import IPermissionService
 from zope.app.interfaces.security import IPermission
+from zope.app.interfaces.services.interfaces import ISimpleService
 
 class Permission:
 
@@ -30,7 +31,7 @@
 
 class PermissionService:
 
-    __implements__ = IPermissionService
+    __implements__ = IPermissionService, ISimpleService
 
     def __init__(self, **kw):
         self._permissions = r = {}


=== Zope3/src/zope/app/browser/security/grants/tests/roleservice.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/browser/security/grants/tests/roleservice.py:1.2	Wed Dec 25 09:12:35 2002
+++ Zope3/src/zope/app/browser/security/grants/tests/roleservice.py	Mon Mar  3 18:16:04 2003
@@ -18,6 +18,7 @@
 
 from zope.app.interfaces.security import IRoleService
 from zope.app.interfaces.security import IRole
+from zope.app.interfaces.services.interfaces import ISimpleService
 
 class Role:
 
@@ -30,7 +31,7 @@
 
 class RoleService:
 
-    __implements__ = IRoleService
+    __implements__ = IRoleService, ISimpleService
 
     def __init__(self, **kw):
         self._roles = r = {}


=== Zope3/src/zope/app/browser/security/grants/tests/test_principalpermissionview.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/security/grants/tests/test_principalpermissionview.py:1.5	Tue Feb 11 21:17:10 2003
+++ Zope3/src/zope/app/browser/security/grants/tests/test_principalpermissionview.py	Mon Mar  3 18:16:04 2003
@@ -32,6 +32,7 @@
 from zope.app.security.settings import Allow, Deny, Unset
 from zope.app.services.tests.placefulsetup \
      import PlacefulSetup
+from zope.app.interfaces.services.interfaces import ISimpleService
 
 class DummyContext:
 
@@ -40,7 +41,7 @@
 
 class DummyPermissionService:
 
-    __implements__ = IPermissionService
+    __implements__ = IPermissionService, ISimpleService
 
     def __init__(self, perm_objs):
         perms = {}
@@ -57,7 +58,7 @@
 
 
 class DummyAuthenticationService:
-    __implements__ = IAuthenticationService
+    __implements__ = IAuthenticationService, ISimpleService
 
     def __init__(self, principals):
         pr = {}


=== Zope3/src/zope/app/browser/security/grants/tests/test_principalroleview.py 1.5 => 1.6 ===
--- Zope3/src/zope/app/browser/security/grants/tests/test_principalroleview.py:1.5	Tue Feb 11 21:17:10 2003
+++ Zope3/src/zope/app/browser/security/grants/tests/test_principalroleview.py	Mon Mar  3 18:16:04 2003
@@ -29,6 +29,7 @@
 from zope.app.interfaces.security import IPrincipalRoleManager
 from zope.app.interfaces.security import IPrincipalRoleMap
 from zope.publisher.browser import TestRequest
+from zope.app.interfaces.services.interfaces import ISimpleService
 
 class DummySetting:
     def __init__(self, name):
@@ -45,7 +46,7 @@
 
 class DummyRoleService:
 
-    __implements__ = IRoleService
+    __implements__ = IRoleService, ISimpleService
 
     def __init__(self, roles):
         self._roles = roles
@@ -66,7 +67,7 @@
 
 class DummyAuthenticationService:
 
-    __implements__ = IAuthenticationService
+    __implements__ = IAuthenticationService, ISimpleService
 
     def __init__(self, principals):
         self._principals = principals