diff options
| author | Chris McDonough <chrism@agendaless.com> | 2009-09-30 03:27:28 +0000 |
|---|---|---|
| committer | Chris McDonough <chrism@agendaless.com> | 2009-09-30 03:27:28 +0000 |
| commit | d75fe70228c89e3606e51a4d5775faf549252a90 (patch) | |
| tree | 043a7334d49a7455b80789f1aab56e4238dbd6b0 /repoze/bfg/security.py | |
| parent | 4be6ce73f41e09bf0f3e5df01d7f5aaf4f3137a6 (diff) | |
| download | pyramid-d75fe70228c89e3606e51a4d5775faf549252a90.tar.gz pyramid-d75fe70228c89e3606e51a4d5775faf549252a90.tar.bz2 pyramid-d75fe70228c89e3606e51a4d5775faf549252a90.zip | |
- The import of ``repoze.bfg.view.NotFound`` is deprecated in favor of
``repoze.bfg.exceptions.NotFound``. The old location still
functions, but emits a deprecation warning.
- The import of ``repoze.bfg.security.Unauthorized`` is deprecated in
favor of ``repoze.bfg.exceptions.Forbidden``. The old location
still functions but emits a deprecation warning. The rename from
``Unauthorized`` to ``Forbidden`` brings parity to the the name of
the exception and the system view it invokes when raised.
- New ``repoze.bfg.exceptions`` module was created to house exceptions
that were previously sprinkled through various modules.
- An ``exceptions`` API chapter was added, documenting the new
``repoze.bfg.exceptions`` module.
Diffstat (limited to 'repoze/bfg/security.py')
| -rw-r--r-- | repoze/bfg/security.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/repoze/bfg/security.py b/repoze/bfg/security.py index 466c33da3..e0873a0ad 100644 --- a/repoze/bfg/security.py +++ b/repoze/bfg/security.py @@ -2,10 +2,21 @@ from zope.component import getSiteManager from zope.component import providedBy from zope.component import queryUtility +from zope.deprecation import deprecated + from repoze.bfg.interfaces import IAuthenticationPolicy from repoze.bfg.interfaces import IAuthorizationPolicy from repoze.bfg.interfaces import ISecuredView +# b/c import +from repoze.bfg.exceptions import Forbidden as Unauthorized + +deprecated('Unauthorized', + "('from repoze.bfg.security import Unauthorized' was " + "deprecated as of repoze.bfg 1.1; instead use 'from " + "repoze.bfg.exceptions import Forbidden')", + ) + Everyone = 'system.Everyone' Authenticated = 'system.Authenticated' Allow = 'Allow' @@ -229,6 +240,3 @@ class ACLAllowed(ACLPermitsResult): as the ``msg`` attribute.""" boolval = 1 -class Unauthorized(Exception): - pass - |
