summaryrefslogtreecommitdiff
path: root/docs/tutorials/wiki2/authorization.rst
diff options
context:
space:
mode:
authorPatricio Paez <pp@pp.com.mx>2011-05-29 16:05:07 -0500
committerPatricio Paez <pp@pp.com.mx>2011-05-30 18:07:56 -0500
commitded6e085fdb6b64d676e96de15e59c0f657c658f (patch)
treec39d6329d0ffaa3c6d9be73a145145331f0d19e7 /docs/tutorials/wiki2/authorization.rst
parentf700c71817d3ab8b98149208e30e26de96616815 (diff)
downloadpyramid-ded6e085fdb6b64d676e96de15e59c0f657c658f.tar.gz
pyramid-ded6e085fdb6b64d676e96de15e59c0f657c658f.tar.bz2
pyramid-ded6e085fdb6b64d676e96de15e59c0f657c658f.zip
Improvements to Adding Authorization of the wiki tutorials
Diffstat (limited to 'docs/tutorials/wiki2/authorization.rst')
-rw-r--r--docs/tutorials/wiki2/authorization.rst14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/tutorials/wiki2/authorization.rst b/docs/tutorials/wiki2/authorization.rst
index b1d3b0001..43231287d 100644
--- a/docs/tutorials/wiki2/authorization.rst
+++ b/docs/tutorials/wiki2/authorization.rst
@@ -9,8 +9,8 @@ view, edit, and add pages to our wiki. For purposes of demonstration
we'll change our application to allow only people whom possess a
specific username (`editor`) to add and edit wiki pages but we'll
continue allowing anyone with access to the server to view pages.
-:app:`Pyramid` provides facilities for *authorization* and
-*authentication*. We'll make use of both features to provide security
+:app:`Pyramid` provides facilities for :term:`authorization` and
+:term:`authentication`. We'll make use of both features to provide security
to our application.
The source code for this tutorial stage can be browsed at
@@ -147,7 +147,7 @@ and adding views, your application's ``__init__.py`` will look like this:
:language: python
Adding ``security.py``
-~~~~~~~~~~~~~~~~~~~~~~
+----------------------
Add a ``security.py`` module within your package (in the same directory as
:file:`__init__.py`, :file:`views.py`, etc) with the following content:
@@ -176,7 +176,7 @@ and the permission associated with the ``add_page`` and ``edit_page``
views, the ``editor`` user should be able to add and edit pages.
Adding Login and Logout Views
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+-----------------------------
We'll add a ``login`` view callable which renders a login form and
processes the post from the login form, checking credentials.
@@ -195,7 +195,7 @@ content:
:language: python
Changing Existing Views
-~~~~~~~~~~~~~~~~~~~~~~~
+-----------------------
Then we need to change each of our ``view_page``, ``edit_page`` and
``add_page`` views in ``views.py`` to pass a "logged in" parameter to its
@@ -221,7 +221,7 @@ We'll then change the return value of these views to pass the `resulting
edit_url = edit_url)
Adding the ``login.pt`` Template
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+--------------------------------
Add a ``login.pt`` template to your templates directory. It's
referred to within the login view we just added to ``login.py``.
@@ -230,7 +230,7 @@ referred to within the login view we just added to ``login.py``.
:language: xml
Change ``view.pt`` and ``edit.pt``
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+----------------------------------
We'll also need to change our ``edit.pt`` and ``view.pt`` templates to
display a "Logout" link if someone is logged in. This link will