[Zope3-checkins] CVS: Zope3/src/zope/app/security/tests - __init__.py:1.3

Jim Fulton jim at zope.com
Sun Apr 11 14:17:02 EDT 2004


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

Modified Files:
	__init__.py 
Log Message:
Added a zcml definition of zope.Public. This was previously defined in
Python, in a way that depended on getting to the global utility
service via a global variable.

Moved the python code to zope.app.security.tests for use in tests.
This is now called by placelesssetup.


=== Zope3/src/zope/app/security/tests/__init__.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/security/tests/__init__.py:1.2	Wed Dec 25 09:13:18 2002
+++ Zope3/src/zope/app/security/tests/__init__.py	Sun Apr 11 14:16:31 2004
@@ -1,2 +1,34 @@
+##############################################################################
 #
-# This file is necessary to make this directory a package.
+# Copyright (c) 2004 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
+# 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.
+#
+##############################################################################
+"""
+$Id$
+"""
+
+from zope.app import zapi
+from zope.app.security.permission import Permission
+from zope.app.security.interfaces import IPermission
+
+def addCheckerPublic():
+    """Add the CheckerPublic permission as 'zope.Public'"""
+
+    utilityService = zapi.getService(None, zapi.servicenames.Utilities)
+
+    perm = Permission('zope.Public', 'Public',
+            """Special permission used for resources that are always public
+
+            The public permission is effectively an optimization, sine
+            it allows security computation to be bypassed.
+            """
+            )
+    utilityService.provideUtility(IPermission, perm, perm.id)




More information about the Zope3-Checkins mailing list