diff options
| author | Chris McDonough <chrism@plope.com> | 2013-11-11 21:14:34 -0500 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2013-11-11 21:14:34 -0500 |
| commit | a5cfb685eed6a32a3ae5aa2af91f1590cd77bc89 (patch) | |
| tree | 31910085ff8be123931819787a8c25e5acf48d1e /docs/tutorials/wiki2/authorization.rst | |
| parent | 133b9e069cdd5a48d47e2bb2587186a91b255700 (diff) | |
| parent | 0dcd56c2c30863c6683c0cf442aa73dfdcd11b13 (diff) | |
| download | pyramid-a5cfb685eed6a32a3ae5aa2af91f1590cd77bc89.tar.gz pyramid-a5cfb685eed6a32a3ae5aa2af91f1590cd77bc89.tar.bz2 pyramid-a5cfb685eed6a32a3ae5aa2af91f1590cd77bc89.zip | |
Merge branch 'feature.security-apis-on-request'
Diffstat (limited to 'docs/tutorials/wiki2/authorization.rst')
| -rw-r--r-- | docs/tutorials/wiki2/authorization.rst | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/docs/tutorials/wiki2/authorization.rst b/docs/tutorials/wiki2/authorization.rst index cf20db6d7..1e5d0dcbf 100644 --- a/docs/tutorials/wiki2/authorization.rst +++ b/docs/tutorials/wiki2/authorization.rst @@ -221,7 +221,7 @@ Add the following import statements to the head of ``tutorial/tutorial/views.py``: .. literalinclude:: src/authorization/tutorial/views.py - :lines: 9-16,18,24-25 + :lines: 9-19 :linenos: :emphasize-lines: 3,6-9,11 :language: python @@ -274,17 +274,6 @@ added to ``views.py``. Return a logged_in flag to the renderer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Add the following line to the import at the head of -``tutorial/tutorial/views.py``: - -.. literalinclude:: src/authorization/tutorial/views.py - :lines: 14-18 - :linenos: - :emphasize-lines: 4 - :language: python - -(Only the highlighted line needs to be added.) - Add a ``logged_in`` parameter to the return value of ``view_page()``, ``edit_page()`` and ``add_page()``, like this: @@ -296,12 +285,12 @@ like this: return dict(page = page, content = content, edit_url = edit_url, - logged_in = authenticated_userid(request)) + logged_in = request.authenticated_userid) (Only the highlighted line needs to be added.) -The :meth:`~pyramid.security.authenticated_userid` method will return None -if the user is not authenticated. +The :meth:`~pyramid.request.Request.authenticated_userid` property will be +``None`` if the user is not authenticated. Add a "Logout" link when logged in ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -349,7 +338,7 @@ when we're done: .. literalinclude:: src/authorization/tutorial/views.py :linenos: - :emphasize-lines: 11,14-18,25,31,37,58,61,73,76,88,91-117,119-123 + :emphasize-lines: 11,14-19,25,31,37,58,61,73,76,88,91-117,119-123 :language: python (Only the highlighted lines need to be added.) |
