From 5f37acda1c8af7cb288e792e2c82f728fe254818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Thu, 2 Jul 2020 17:06:02 -0400 Subject: improve doc Co-Authored-By: Steve Piercy --- src/pyramid/config/routes.py | 13 +++++++------ src/pyramid/config/views.py | 14 ++++++++------ 2 files changed, 15 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/pyramid/config/routes.py b/src/pyramid/config/routes.py index feb28c7a7..4f3440c40 100644 --- a/src/pyramid/config/routes.py +++ b/src/pyramid/config/routes.py @@ -270,12 +270,12 @@ class RoutesConfiguratorMixin: is_authenticated - This value, if specified, should be either ``True`` or ``False``. - If it is specified and is ``True``, the route will only match if - the request has an authenticated user, as determined by the - :term:`security policy` in use. If it is specified and ``False``, - the route will only match if the request does not have an - authenticated user. + This value, if specified, must be either ``True`` or ``False``. + If it is specified and ``True``, only a request from an authenticated + user, as determined by the :term:`security policy` in use, will + satisfy the predicate. + If it is specified and ``False``, only a request from a user who is + not authenticated will satisfy the predicate. .. versionadded:: 2.0 @@ -293,6 +293,7 @@ class RoutesConfiguratorMixin: .. versionadded:: 1.4a4 .. deprecated:: 2.0 + Use ``is_authenticated`` or a custom predicate. custom_predicates diff --git a/src/pyramid/config/views.py b/src/pyramid/config/views.py index 4a5723a14..26b69beb9 100644 --- a/src/pyramid/config/views.py +++ b/src/pyramid/config/views.py @@ -714,13 +714,14 @@ class ViewsConfiguratorMixin: is_authenticated - This value, if specified, should be either ``True`` or ``False``. - If it is specified and is ``True``, the request must be for an - authenticated user, as determined by the :term:`security policy` in - use. If it is specified and ``False``, the associated view callable - will match only if the request does not have an authenticated user. + This value, if specified, must be either ``True`` or ``False``. + If it is specified and ``True``, only a request from an authenticated + user, as determined by the :term:`security policy` in use, will + satisfy the predicate. + If it is specified and ``False``, only a request from a user who is + not authenticated will satisfy the predicate. - ..versionadded:: 2.0 + .. versionadded:: 2.0 effective_principals @@ -736,6 +737,7 @@ class ViewsConfiguratorMixin: .. versionadded:: 1.4a4 .. deprecated:: 2.0 + Use ``is_authenticated`` or a custom predicate. custom_predicates -- cgit v1.2.3