Skip to content

Commit

Permalink
Add compatibility with AccessControl 4.0a4. (#94)
Browse files Browse the repository at this point in the history
* Add compatibility with AccessControl 4.0a4.

* Fix version here, too.

* bin/alltests needs a branch of Products.ZCatalog to run successfully.

* Use a new ZCatalog release.
  • Loading branch information
Michael Howitz authored and hannosch committed Feb 2, 2017
1 parent e9a418e commit 515d788
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 15 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ Features Added

- Updated distributions:

- AccessControl = 4.0a4
- Acquisition = 4.3.0
- BTrees = 4.4.0
- DocumentTemplate = 3.0a1
- persistent = 4.2.2
- Products.ZCatalog = 4.0a3
- pytz = 2016.10
- WebOb = 1.7.1
- WebTest = 2.0.24
Expand Down
4 changes: 2 additions & 2 deletions requirements-full.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-e git+https://github.com/zopefoundation/Zope.git@master#egg=Zope2
AccessControl==4.0a3
AccessControl==4.0a4
Acquisition==4.3.0
AuthEncoding==4.0.0
BTrees==4.4.0
Expand All @@ -14,7 +14,7 @@ Persistence==3.0a1
Products.BTreeFolder2==3.0
Products.MailHost==3.0
Products.ZCTextIndex==4.0.1
Products.ZCatalog==4.0a2
Products.ZCatalog==4.0a3
Record==3.1
RestrictedPython==3.6.0
WSGIProxy2==0.4.2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def _read_file(filename):
namespace_packages=['Products', 'Shared', 'Shared.DC'],
package_dir={'': 'src'},
install_requires=[
'AccessControl>=4.0a1',
'AccessControl>=4.0a4',
'Acquisition',
'BTrees',
'DateTime',
Expand Down
2 changes: 1 addition & 1 deletion sources.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ zope.globalrequest = git ${remotes:github}/zope.globalrequest pushurl=${remotes:
Missing = git ${remotes:github}/Missing pushurl=${remotes:github_push}/Missing
Products.BTreeFolder2 = git ${remotes:github}/Products.BTreeFolder2 pushurl=${remotes:github_push}/Products.BTreeFolder2
Products.MailHost = git ${remotes:github}/Products.MailHost pushurl=${remotes:github_push}/Products.MailHost
Products.ZCatalog = git ${remotes:github}/Products.ZCatalog pushurl=${remotes:github_push}/Products.ZCatalog branch=master
Products.ZCatalog = git ${remotes:github}/Products.ZCatalog pushurl=${remotes:github_push}/Products.ZCatalog
Products.ZCTextIndex = git ${remotes:github}/Products.ZCTextIndex pushurl=${remotes:github_push}/Products.ZCTextIndex
Record = git ${remotes:github}/Record pushurl=${remotes:github_push}/Record
ZServer = git ${remotes:github}/ZServer pushurl=${remotes:github_push}/ZServer
Expand Down
11 changes: 2 additions & 9 deletions src/OFS/FindSupport.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@
##############################################################################
"""Find support
"""

from string import translate

from AccessControl import ClassSecurityInfo
from AccessControl.class_init import InitializeClass
from AccessControl.Permission import name_trans
from AccessControl.Permission import getPermissionIdentifier
from AccessControl.Permissions import view_management_screens
from Acquisition import aq_base, aq_parent
from App.special_dtml import DTMLFile
Expand Down Expand Up @@ -92,7 +89,7 @@ def ZopeFindAndApply(self, obj, obj_ids=None, obj_metatypes=None,
obj_mtime = DateTime(obj_mtime).timeTime()

if obj_permission:
obj_permission = p_name(obj_permission)
obj_permission = getPermissionIdentifier(obj_permission)

if obj_roles and isinstance(obj_roles, str):
obj_roles = [obj_roles]
Expand Down Expand Up @@ -218,7 +215,3 @@ def absattr(attr):
if isinstance(attr, collections.Callable):
return attr()
return attr


def p_name(name):
return '_' + translate(name, name_trans) + '_Permission'
4 changes: 2 additions & 2 deletions versions-prod.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[versions]
Zope2 =
AccessControl = 4.0a3
AccessControl = 4.0a4
AuthEncoding = 4.0.0
Acquisition = 4.3.0
BTrees = 4.4.0
Expand All @@ -21,7 +21,7 @@ Persistence = 3.0a1
persistent = 4.2.2
Products.BTreeFolder2 = 3.0
Products.MailHost = 3.0
Products.ZCatalog = 4.0a2
Products.ZCatalog = 4.0a3
Products.ZCTextIndex = 4.0.1
pytz = 2016.10
Record = 3.1
Expand Down

0 comments on commit 515d788

Please sign in to comment.