From c16929f07ff38728a6a96f4e6d25bf5966ff882e Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 23 Jun 2009 17:33:50 +0000 Subject: Update tutorials with new callback API. --- docs/tutorials/bfgwiki/authorization.rst | 13 +++++++------ docs/tutorials/bfgwiki/src/authorization/tutorial/run.py | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'docs/tutorials/bfgwiki') diff --git a/docs/tutorials/bfgwiki/authorization.rst b/docs/tutorials/bfgwiki/authorization.rst index bd4e80206..e493852ec 100644 --- a/docs/tutorials/bfgwiki/authorization.rst +++ b/docs/tutorials/bfgwiki/authorization.rst @@ -29,12 +29,13 @@ the policy, and pass it as the ``authentication_policy`` argument to the ``make_app`` function. The first positional argument of an ``AuthTktAuthenticationPolicy`` is a secret used to encrypt cookie data. Its second argument ("callback") should be a callable that -accepts a userid. If the userid exists in the system, the callback -should return a sequence of group identifiers (or an empty sequence if -the user isn't a member of any groups). If the userid *does not* -exist in the system, the callback should return ``None``. We'll use -"dummy" data to represent user and groups sources. When we're done, -your application's ``run.py`` will look like this. +accepts a userid ana a request. If the userid exists in the system, +the callback should return a sequence of group identifiers (or an +empty sequence if the user isn't a member of any groups). If the +userid *does not* exist in the system, the callback should return +``None``. We'll use "dummy" data to represent user and groups +sources. When we're done, your application's ``run.py`` will look +like this. .. literalinclude:: src/authorization/tutorial/run.py :linenos: diff --git a/docs/tutorials/bfgwiki/src/authorization/tutorial/run.py b/docs/tutorials/bfgwiki/src/authorization/tutorial/run.py index a5d0cf39c..32faa5899 100644 --- a/docs/tutorials/bfgwiki/src/authorization/tutorial/run.py +++ b/docs/tutorials/bfgwiki/src/authorization/tutorial/run.py @@ -25,7 +25,7 @@ USERS = {'editor':'editor', 'viewer':'viewer'} GROUPS = {'editor':['group.editors']} -def groupfinder(userid): +def groupfinder(userid, request): if userid in USERS: return GROUPS.get(userid, []) -- cgit v1.2.3