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