Merge lp:~jml/launchpad/docs-for-interaction into lp:launchpad

Proposed by Jonathan Lange
Status: Merged
Approved by: Robert Collins
Approved revision: no longer in the source branch.
Merged at revision: 11117
Proposed branch: lp:~jml/launchpad/docs-for-interaction
Merge into: lp:launchpad
Diff against target: 40 lines (+30/-1)
1 file modified
lib/canonical/launchpad/webapp/interaction.py (+30/-1)
To merge this branch: bzr merge lp:~jml/launchpad/docs-for-interaction
Reviewer Review Type Date Requested Status
Robert Collins (community) Approve
Review via email: mp+29632@code.launchpad.net

Description of the change

Documentation about how our interaction system works.

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

This is a clear improvement, and it sounds plausible :).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/webapp/interaction.py'
2--- lib/canonical/launchpad/webapp/interaction.py 2010-07-09 12:20:31 +0000
3+++ lib/canonical/launchpad/webapp/interaction.py 2010-07-10 14:35:53 +0000
4@@ -1,7 +1,36 @@
5 # Copyright 2009 Canonical Ltd. This software is licensed under the
6 # GNU Affero General Public License version 3 (see the file LICENSE).
7
8-"""Methods dealing with interactions."""
9+"""Methods dealing with interactions.
10+
11+Almost everything in Launchpad relies on a security policy, in particular
12+retrieving utilities and accessing attributes.
13+
14+Zope obtains the security policy by looking at the 'interaction', which is a
15+thread-local variable. If there is no interaction, one is likely to encounter
16+an error like:
17+
18+ AttributeError("'thread._local' object has no attribute 'interaction'")
19+
20+In Launchpad, we frequently refer to the state of having no interaction as
21+being "logged out".
22+
23+Because one needs an interaction to do practically anything, and because
24+Launchpad allows anonymous access, it is possible to create an interaction
25+(informally, "log in") for a mythical anonymous user.
26+
27+The object representing the logged-in user is called the "principal", and the
28+relationship between the principal and the interaction is called the
29+"participation".
30+
31+In Launchpad and in standard usage, the participation is the request and the
32+principal is the requesting user. Although Zope has support for more than one
33+of these, we only ever allow one.
34+
35+There are test helpers in `lp.testing._login`.
36+
37+See also lib/canonical/launchpad/doc/webapp-authorization.txt.
38+"""
39
40 __metaclass__ = type
41