diff options
| author | Chris McDonough <chrism@plope.com> | 2011-04-22 19:49:29 -0400 |
|---|---|---|
| committer | Chris McDonough <chrism@plope.com> | 2011-04-22 19:49:29 -0400 |
| commit | df3d80dca92f3ae023ecc900338c76de6106cc0b (patch) | |
| tree | 293f2b9a234e864c030dcd7ed1b43459dc50e59b /docs/tutorials/wiki2/authorization.rst | |
| parent | bf8c8f7c8e88e81a9f8c75c435c28e6269df049c (diff) | |
| parent | 89346583ec29dcc5d973cc807ae9899cf81b06ef (diff) | |
| download | pyramid-df3d80dca92f3ae023ecc900338c76de6106cc0b.tar.gz pyramid-df3d80dca92f3ae023ecc900338c76de6106cc0b.tar.bz2 pyramid-df3d80dca92f3ae023ecc900338c76de6106cc0b.zip | |
fix merge conflicts
Diffstat (limited to 'docs/tutorials/wiki2/authorization.rst')
| -rw-r--r-- | docs/tutorials/wiki2/authorization.rst | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/docs/tutorials/wiki2/authorization.rst b/docs/tutorials/wiki2/authorization.rst index d0354af99..19d438fad 100644 --- a/docs/tutorials/wiki2/authorization.rst +++ b/docs/tutorials/wiki2/authorization.rst @@ -76,7 +76,14 @@ For any :app:`Pyramid` application to perform authorization, we need to add a We'll change our ``__init__.py`` file to enable an ``AuthTktAuthenticationPolicy`` and an ``ACLAuthorizationPolicy`` to enable -declarative security checking. +declarative security checking. We need to import the new policies: + +.. literalinclude:: src/authorization/tutorial/__init__.py + :lines: 2-3,8 + :linenos: + :language: python + +Then, we'll add those policies to the configuration: .. literalinclude:: src/authorization/tutorial/__init__.py :lines: 15-21 @@ -97,13 +104,20 @@ We'll also change ``__init__.py``, adding a call to :term:`view callable`. This is also known as a :term:`forbidden view`: .. literalinclude:: src/authorization/tutorial/__init__.py - :lines: 41-43 + :lines: 24-26,41-43 :linenos: :language: python A forbidden view configures our newly created login view to show up when :app:`Pyramid` detects that a view invocation can not be authorized. +A ``logout`` :term:`view callable` will allow users to log out later: + +.. literalinclude:: src/authorization/tutorial/__init__.py + :lines: 27-28 + :linenos: + :language: python + We'll also add ``permission`` arguments with the value ``edit`` to the ``edit_page`` and ``add_page`` views. This indicates that the view callables which these views reference cannot be invoked without the |
