[Zope3-checkins] CVS: Zope3/src/zope/app/security - _protections.py:1.1.2.2 basicauthadapter.py:1.1.2.2 basicvfsauthadapter.py:1.1.2.2 exceptions.py:1.1.2.2 loginpassword.py:1.1.2.2 metaconfigure.py:1.1.2.2 permissionfield.py:1.1.2.2 protectclass.py:1.1.2.3 settings.py:1.1.2.2 zopesecuritypolicy.py:1.1.2.4
Tim Peters
tim.one@comcast.net
Tue, 24 Dec 2002 21:21:47 -0500
Update of /cvs-repository/Zope3/src/zope/app/security
In directory cvs.zope.org:/tmp/cvs-serv19240/src/zope/app/security
Modified Files:
Tag: NameGeddon-branch
_protections.py basicauthadapter.py basicvfsauthadapter.py
exceptions.py loginpassword.py metaconfigure.py
permissionfield.py protectclass.py settings.py
zopesecuritypolicy.py
Log Message:
Whitespace normalization, via Python's Tools/scripts/reindent.py. The
files are fixed-points of that script now. Fixed a few cases where
code relied on significant trailing whitespace (ouch).
=== Zope3/src/zope/app/security/_protections.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/_protections.py:1.1.2.1 Mon Dec 23 14:32:15 2002
+++ Zope3/src/zope/app/security/_protections.py Tue Dec 24 21:20:45 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 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
-#
+#
##############################################################################
"""Register protection information for some standard low-level types
@@ -23,8 +23,8 @@
# excluding _check, _bucket_type, _firstbucket, and write operations
_btreeChecker = NamesChecker(['__str__', '__repr__', '__contains__',
- '__getitem__', '__iter__', '__len__',
- 'byValue', 'get', 'has_key', 'items',
+ '__getitem__', '__iter__', '__len__',
+ 'byValue', 'get', 'has_key', 'items',
'iteritems', 'iterkeys', 'itervalues',
'keys', 'maxKey', 'minKey', 'values'])
@@ -33,20 +33,20 @@
'__contains__', '__getitem__', '__iter__', '__len__', '__repr__',
'__str__', 'byValue', 'get', 'has_key', 'items', 'iteritems',
'iterkeys', 'itervalues', 'keys', 'maxKey','minKey', 'values'])
-
+
_btreeSetChecker = NamesChecker([
'__contains__', '__getitem__', '__iter__', '__len__', '__repr__',
'__str__', 'has_key', 'insert', 'keys', 'maxKey', 'minKey'])
-
+
# excluding _bucket_type, _check
_btreeTreeSetChecker = NamesChecker([
'__contains__', '__iter__', '__len__', '__repr__',
'__str__', 'has_key', 'insert', 'keys', 'maxKey', 'minKey'])
-
+
_btreeItemsChecker = NamesChecker([
'__iter__', '__repr__', '__str__', '__getitem__', '__len__',
'__contains__'])
-
+
_iteratorChecker = NamesChecker(['next'])
from zodb.btrees.IIBTree import IIBTree, IIBucket, IISet, IITreeSet
@@ -54,7 +54,7 @@
from zodb.btrees.OIBTree import OIBTree, OIBucket, OISet, OITreeSet
from zodb.btrees.OOBTree import OOBTree, OOBucket, OOSet, OOTreeSet
- _btree_checkers = {
+ _btree_checkers = {
IIBTree: _btreeChecker,
IOBTree: _btreeChecker,
OIBTree: _btreeChecker,
=== Zope3/src/zope/app/security/basicauthadapter.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/basicauthadapter.py:1.1.2.1 Mon Dec 23 14:32:15 2002
+++ Zope3/src/zope/app/security/basicauthadapter.py Tue Dec 24 21:20:45 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 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.
-#
+#
##############################################################################
# HTTP Basic Authentication adapter
=== Zope3/src/zope/app/security/basicvfsauthadapter.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/basicvfsauthadapter.py:1.1.2.1 Mon Dec 23 14:32:15 2002
+++ Zope3/src/zope/app/security/basicvfsauthadapter.py Tue Dec 24 21:20:45 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 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.
-#
+#
##############################################################################
# HTTP Basic Authentication adapter
=== Zope3/src/zope/app/security/exceptions.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/exceptions.py:1.1.2.1 Mon Dec 23 14:32:15 2002
+++ Zope3/src/zope/app/security/exceptions.py Tue Dec 24 21:20:45 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 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.
-#
+#
##############################################################################
"""
=== Zope3/src/zope/app/security/loginpassword.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/loginpassword.py:1.1.2.1 Mon Dec 23 14:32:15 2002
+++ Zope3/src/zope/app/security/loginpassword.py Tue Dec 24 21:20:45 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 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.
-#
+#
##############################################################################
from zope.app.interfaces.security import ILoginPassword
=== Zope3/src/zope/app/security/metaconfigure.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/metaconfigure.py:1.1.2.1 Mon Dec 23 14:32:15 2002
+++ Zope3/src/zope/app/security/metaconfigure.py Tue Dec 24 21:20:45 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 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.
-#
+#
##############################################################################
""" Register security related configuration directives.
@@ -30,5 +30,3 @@
args = (policy,),
)
]
-
-
=== Zope3/src/zope/app/security/permissionfield.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/permissionfield.py:1.1.2.1 Mon Dec 23 14:32:15 2002
+++ Zope3/src/zope/app/security/permissionfield.py Tue Dec 24 21:20:45 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2002 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.
-#
+#
##############################################################################
"""These are the interfaces for the common fields.
@@ -34,4 +34,3 @@
service = getService(self.context, 'Permissions')
if service.getPermission(value.getId()) is None:
raise ValidationError("Unknown permission", value)
-
=== Zope3/src/zope/app/security/protectclass.py 1.1.2.2 => 1.1.2.3 ===
--- Zope3/src/zope/app/security/protectclass.py:1.1.2.2 Tue Dec 24 07:51:16 2002
+++ Zope3/src/zope/app/security/protectclass.py Tue Dec 24 21:20:45 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 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.
-#
+#
##############################################################################
"""Make assertions about permissions needed to access class instances attributes
"""
@@ -28,9 +28,9 @@
def protectName(class_, name, permission):
"Set a permission on a particular name."
-
+
checkPermission(permission)
-
+
checker = getCheckerForInstancesOf(class_)
if checker is None:
checker = Checker({}.get, {}.get)
@@ -41,14 +41,14 @@
permission = CheckerPublic
# We know a dictionart get method was used because we set it
- protections = checker.getPermission_func().__self__
+ protections = checker.getPermission_func().__self__
protections[name] = permission
def protectSetAttribute(class_, name, permission):
"Set a permission on a particular name."
-
+
checkPermission(permission)
-
+
checker = getCheckerForInstancesOf(class_)
if checker is None:
checker = Checker({}.get, {}.get)
@@ -59,20 +59,20 @@
permission = CheckerPublic
# We know a dictionart get method was used because we set it
- protections = checker.getSetattrPermission_func().__self__
+ protections = checker.getSetattrPermission_func().__self__
protections[name] = permission
def protectLikeUnto(class_, like_unto):
"""Use the protections from like_unto for class_
"""
-
+
unto_checker = getCheckerForInstancesOf(like_unto)
if unto_checker is None:
return
# We know a dictionart get method was used because we set it
unto_protections = unto_checker.getPermission_func().__self__
-
+
checker = getCheckerForInstancesOf(class_)
if checker is None:
checker = Checker({}.get)
=== Zope3/src/zope/app/security/settings.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/security/settings.py:1.1.2.1 Mon Dec 23 14:32:15 2002
+++ Zope3/src/zope/app/security/settings.py Tue Dec 24 21:20:45 2002
@@ -64,4 +64,3 @@
Unset = PermissionSetting('Unset',
'Unset constant that denotes no setting for permission and role')
-
=== Zope3/src/zope/app/security/zopesecuritypolicy.py 1.1.2.3 => 1.1.2.4 ===
--- Zope3/src/zope/app/security/zopesecuritypolicy.py:1.1.2.3 Mon Dec 23 18:52:34 2002
+++ Zope3/src/zope/app/security/zopesecuritypolicy.py Tue Dec 24 21:20:45 2002
@@ -2,14 +2,14 @@
#
# Copyright (c) 2001, 2002 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.
-#
+#
##############################################################################
""" Define Zope\'s default security policy
@@ -33,13 +33,13 @@
from zope.app.interfaces.security \
import IPrincipalRoleManager, IPrincipalRoleMap
from zope.app.interfaces.security import IRolePermissionManager
-from zope.app.security.registries.permissionregistry import permissionRegistry
-from zope.app.security.registries.principalregistry import principalRegistry
+from zope.app.security.registries.permissionregistry import permissionRegistry
+from zope.app.security.registries.principalregistry import principalRegistry
from zope.app.security.registries.roleregistry import roleRegistry
from zope.app.security.grants.principalpermissionmanager \
- import principalPermissionManager
+ import principalPermissionManager
from zope.app.security.grants.rolepermissionmanager \
- import rolePermissionManager
+ import rolePermissionManager
from zope.app.security.grants.principalrolemanager \
import principalRoleManager
from zope.app.security.settings import Allow, Deny
@@ -66,7 +66,7 @@
The default is true.
authenticated -- Allow access to resources based on the
- privaledges of the authenticated user.
+ privaledges of the authenticated user.
The argument must have a truth value.
The default is true.
@@ -77,7 +77,7 @@
clients allow only public access and other
clients allow full management.
"""
-
+
self._ownerous = ownerous
self._authenticated = authenticated
@@ -88,9 +88,9 @@
user = context.user
if user is system_user:
return 1
-
+
principals = {user : {'Anonymous': Allow}}
-
+
role_permissions = {}
remove = {}
@@ -184,7 +184,7 @@
else:
# we've eliminated all the principals
return 1
-
+
# Collect principal roles
prinrole = queryAdapter(place, IPrincipalRoleMap)
if prinrole is not None:
@@ -270,7 +270,7 @@
if role not in roles:
roles[role] = setting
- # Second, update permissions using principal
+ # Second, update permissions using principal
for perm, role, setting in (
rolePermissionManager.getRolesAndPermissions()):
@@ -297,4 +297,3 @@
zopeSecurityPolicy=ZopeSecurityPolicy()
-