summaryrefslogtreecommitdiff
path: root/docs/api
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2013-11-11 21:14:34 -0500
committerChris McDonough <chrism@plope.com>2013-11-11 21:14:34 -0500
commita5cfb685eed6a32a3ae5aa2af91f1590cd77bc89 (patch)
tree31910085ff8be123931819787a8c25e5acf48d1e /docs/api
parent133b9e069cdd5a48d47e2bb2587186a91b255700 (diff)
parent0dcd56c2c30863c6683c0cf442aa73dfdcd11b13 (diff)
downloadpyramid-a5cfb685eed6a32a3ae5aa2af91f1590cd77bc89.tar.gz
pyramid-a5cfb685eed6a32a3ae5aa2af91f1590cd77bc89.tar.bz2
pyramid-a5cfb685eed6a32a3ae5aa2af91f1590cd77bc89.zip
Merge branch 'feature.security-apis-on-request'
Diffstat (limited to 'docs/api')
-rw-r--r--docs/api/request.rst42
1 files changed, 41 insertions, 1 deletions
diff --git a/docs/api/request.rst b/docs/api/request.rst
index 72abddb68..b7604020e 100644
--- a/docs/api/request.rst
+++ b/docs/api/request.rst
@@ -11,7 +11,9 @@
:exclude-members: add_response_callback, add_finished_callback,
route_url, route_path, current_route_url,
current_route_path, static_url, static_path,
- model_url, resource_url, set_property
+ model_url, resource_url, set_property,
+ effective_principals, authenticated_userid,
+ unauthenticated_userid, has_permission
.. attribute:: context
@@ -161,6 +163,42 @@
request, the value of this attribute will be ``None``. See
:ref:`matched_route`.
+ .. attribute:: authenticated_userid
+
+ .. versionadded:: 1.5
+
+ A property which returns the userid of the currently authenticated user
+ or ``None`` if there is no :term:`authentication policy` in effect or
+ there is no currently authenticated user. This differs from
+ :attr:`~pyramid.request.Request.unauthenticated_userid`, because the
+ effective authentication policy will have ensured that a record
+ associated with the userid exists in persistent storage; if it has
+ not, this value will be ``None``.
+
+ .. attribute:: unauthenticated_userid
+
+ .. versionadded:: 1.5
+
+ A property which returns a value which represents the *claimed* (not
+ verified) user id of the credentials present in the request. ``None`` if
+ there is no :term:`authentication policy` in effect or there is no user
+ data associated with the current request. This differs from
+ :attr:`~pyramid.request.Request.authenticated_userid`, because the
+ effective authentication policy will not ensure that a record associated
+ with the userid exists in persistent storage. Even if the userid
+ does not exist in persistent storage, this value will be the value
+ of the userid *claimed* by the request data.
+
+ .. attribute:: effective_principals
+
+ .. versionadded:: 1.5
+
+ A property which returns the list of 'effective' :term:`principal`
+ identifiers for this request. This will include the userid of the
+ currently authenticated user if a user is currently authenticated. If no
+ :term:`authentication policy` is in effect, this will return a sequence
+ containing only the :attr:`pyramid.security.Everyone` principal.
+
.. method:: invoke_subrequest(request, use_tweens=False)
.. versionadded:: 1.4a1
@@ -215,6 +253,8 @@
request provided by e.g. the ``pshell`` environment. For more
information, see :ref:`subrequest_chapter`.
+ .. automethod:: has_permission
+
.. automethod:: add_response_callback
.. automethod:: add_finished_callback