From f4108da64a4f24d5710c7e03389a9316cf62d342 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Wed, 27 May 2009 23:46:20 +0000 Subject: - Added deprecations for imports of ``ACLSecurityPolicy``, ``InheritingACLSecurityPolicy``, ``RemoteUserACLSecurityPolicy``, ``RemoteUserInheritingACLSecurityPolicy``, ``WhoACLSecurityPolicy``, and ``WhoInheritingACLSecurityPolicy`` from the ``repoze.bfg.security`` module; for the meantime (for backwards compatibility purposes) these live in the ``repoze.bfg.secpols`` module. Note however, that the entire concept of a "security policy" is deprecated in BFG in favor of separate authentication and authorization policies, so any use of a security policy will generate additional deprecation warnings even if you do start using ``repoze.bfg.secpols``. ``repoze.bfg.secpols`` will disappear in a future release of ``repoze.bfg``. --- CHANGES.txt | 16 ++++++++++++++++ repoze/bfg/security.py | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/CHANGES.txt b/CHANGES.txt index 0c792cfcf..0a476b3f0 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -8,6 +8,22 @@ Documentation step-by-step how to create a traversal-based ZODB application with authentication. +Deprecation Additions +--------------------- + +- Added deprecations for imports of ``ACLSecurityPolicy``, + ``InheritingACLSecurityPolicy``, ``RemoteUserACLSecurityPolicy``, + ``RemoteUserInheritingACLSecurityPolicy``, ``WhoACLSecurityPolicy``, + and ``WhoInheritingACLSecurityPolicy`` from the + ``repoze.bfg.security`` module; for the meantime (for backwards + compatibility purposes) these live in the ``repoze.bfg.secpols`` + module. Note however, that the entire concept of a "security + policy" is deprecated in BFG in favor of separate authentication and + authorization policies, so any use of a security policy will + generate additional deprecation warnings even if you do start using + ``repoze.bfg.secpols``. ``repoze.bfg.secpols`` will disappear in a + future release of ``repoze.bfg``. + Deprecated Alias Removals ------------------------- diff --git a/repoze/bfg/security.py b/repoze/bfg/security.py index 5f5252ff3..f72f6eb7d 100644 --- a/repoze/bfg/security.py +++ b/repoze/bfg/security.py @@ -2,6 +2,8 @@ import warnings from zope.component import queryMultiAdapter from zope.component import queryUtility +from zope.deprecation import deprecated + from zope.interface import implements from repoze.bfg.interfaces import IAuthenticationPolicy @@ -287,3 +289,17 @@ from repoze.bfg.secpols import WhoACLSecurityPolicy from repoze.bfg.secpols import WhoInheritingACLSecurityPolicy # /BBB imports +for name in ('ACLSecurityPolicy', + 'InheritingACLSecurityPolicy', + 'RemoteUserACLSecurityPolicy', + 'RemoteUserInheritingACLSecurityPolicy', + 'WhoACLSecurityPolicy', + 'WhoInheritingACLSecurityPolicy'): + deprecated(name, + ('repoze.bfg.security.%s should be imported from ' + 'repoze.bfg.secpols.%s as of BFG 0.9. Please consider ' + 'disusing any security policy in favor of separate ' + 'authorization and authentication policies; security ' + 'policies themselves are deprecated as of BFG 0.9; see the ' + 'Security chapter of the BFG docs for the new spellings.'% + (name, name))) -- cgit v1.2.3