Skip to content

Commit

Permalink
- Prevent DeprecationWarnigs from moved imports in AccessControl
Browse files Browse the repository at this point in the history
  • Loading branch information
dataflake committed Jul 28, 2021
1 parent 98da5ef commit 124539e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ https://zope.readthedocs.io/en/2.13/CHANGES.html
4.6.3 (unreleased)
------------------

- Prevent ``DeprecationWarnigs`` from moved imports in ``AccessControl``

- make sure "Manager" users can always modify proxy roles
(`see Products.PythonScripts#50
<https://github.com/zopefoundation/Products.PythonScripts/issues/50>`_)
Expand Down
8 changes: 4 additions & 4 deletions src/OFS/tests/testObjectManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SecurityManagement import noSecurityManager
from AccessControl.SecurityManager import setSecurityPolicy
from AccessControl.SpecialUsers import emergency_user
from AccessControl.SpecialUsers import nobody
from AccessControl.SpecialUsers import system
from AccessControl.User import User # before SpecialUsers
from AccessControl.users import User
from AccessControl.users import emergency_user
from AccessControl.users import nobody
from AccessControl.users import system
from Acquisition import Implicit
from Acquisition import aq_self
from App.config import getConfiguration
Expand Down
2 changes: 1 addition & 1 deletion src/OFS/tests/test_DTMLMethod.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

def _lock_item(item):
from OFS.LockItem import LockItem
from AccessControl.SpecialUsers import nobody
from AccessControl.users import nobody
item.wl_setLock('token', LockItem(nobody, token='token'))


Expand Down
2 changes: 1 addition & 1 deletion src/ZPublisher/tests/testBaseRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ class AclUsers(Implicit):
def validate(self, request, auth='', roles=_noroles):
# always validate access as anonymous, good for checking
# if things are publishable regardless of authorization
from AccessControl.SpecialUsers import nobody
from AccessControl.users import nobody
return nobody.__of__(self)
acl_users = AclUsers()
return acl_users
Expand Down
4 changes: 2 additions & 2 deletions src/Zope2/App/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import six

import AccessControl.User
import AccessControl.users
import App.ZApplication
import OFS.Application
import ZODB
Expand Down Expand Up @@ -137,7 +137,7 @@ def startup():
DB.classFactory = ClassFactory.ClassFactory

# "Log on" as system user
newSecurityManager(None, AccessControl.User.system)
newSecurityManager(None, AccessControl.users.system)

# Set up the CA
load_zcml()
Expand Down
2 changes: 1 addition & 1 deletion src/Zope2/utilities/zconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import Zope2
from AccessControl.SecurityManagement import newSecurityManager
from AccessControl.SpecialUsers import system as user
from AccessControl.users import system as user
from Testing.makerequest import makerequest
from Zope2.Startup.run import make_wsgi_app
from zope.globalrequest import setRequest
Expand Down

0 comments on commit 124539e

Please sign in to comment.