summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMichael Merickel <github@m.merickel.org>2018-10-14 21:02:13 -0500
committerGitHub <noreply@github.com>2018-10-14 21:02:13 -0500
commitd8a08302f3b38da8a5d9b854afbe346d84c534c2 (patch)
tree203910773fa33ddc83aee05c6b20d0ddf6168a57 /docs
parent05915720f97df868e0b7dcff6e9b8eed964b8a90 (diff)
parenta7e16c231c05ca8bea3271632a347e7eac96cb9d (diff)
downloadpyramid-d8a08302f3b38da8a5d9b854afbe346d84c534c2.tar.gz
pyramid-d8a08302f3b38da8a5d9b854afbe346d84c534c2.tar.bz2
pyramid-d8a08302f3b38da8a5d9b854afbe346d84c534c2.zip
Merge pull request #3386 from Pylons/update-auth-policy-docs
Update documentation for implementing custom authz policy
Diffstat (limited to 'docs')
-rw-r--r--docs/narr/security.rst12
1 files changed, 7 insertions, 5 deletions
diff --git a/docs/narr/security.rst b/docs/narr/security.rst
index 5bccd6d52..6b6f9a1f1 100644
--- a/docs/narr/security.rst
+++ b/docs/narr/security.rst
@@ -714,14 +714,16 @@ object that implements the following interface:
.. code-block:: python
:linenos:
- class IAuthorizationPolicy(object):
+ class IAuthorizationPolicy(Interface):
""" An object representing a Pyramid authorization policy. """
- def permits(self, context, principals, permission):
- """ Return ``True`` if any of the ``principals`` is allowed the
- ``permission`` in the current ``context``, else return ``False``
+ def permits(context, principals, permission):
+ """ Return an instance of :class:`pyramid.security.Allowed` if any
+ of the ``principals`` is allowed the ``permission`` in the current
+ ``context``, else return an instance of
+ :class:`pyramid.security.Denied`.
"""
- def principals_allowed_by_permission(self, context, permission):
+ def principals_allowed_by_permission(context, permission):
""" Return a set of principal identifiers allowed by the
``permission`` in ``context``. This behavior is optional; if you
choose to not implement it you should define this method as