Merge lp:~wgrant/launchpad/anonymous-irc-nicks-and-wiki-names into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: Guilherme Salgado
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp:~wgrant/launchpad/anonymous-irc-nicks-and-wiki-names
Merge into: lp:launchpad
Diff against target: 54 lines (+20/-0)
2 files modified
lib/canonical/launchpad/security.py (+10/-0)
lib/lp/registry/stories/webservice/xx-person.txt (+10/-0)
To merge this branch: bzr merge lp:~wgrant/launchpad/anonymous-irc-nicks-and-wiki-names
Reviewer Review Type Date Requested Status
Guilherme Salgado (community) code Approve
Review via email: mp+21219@code.launchpad.net

Commit message

Allow anonymous API clients to list a person's IRC nicks and wiki names.

Description of the change

The trivial addition of two AnonymousAuthorization derivatives for a person's IRC IDs and wiki names, and similarly trivial tests. This lets anonymous API clients list the objects.

To post a comment you must log in.
Revision history for this message
Guilherme Salgado (salgado) wrote :

Looks good to me.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/launchpad/security.py'
2--- lib/canonical/launchpad/security.py 2010-03-10 23:20:31 +0000
3+++ lib/canonical/launchpad/security.py 2010-03-12 09:09:18 +0000
4@@ -86,6 +86,8 @@
5 from lp.registry.interfaces.productseries import IProductSeries
6 from lp.registry.interfaces.projectgroup import (
7 IProjectGroup, IProjectGroupSet)
8+from lp.registry.interfaces.irc import IIrcID
9+from lp.registry.interfaces.wikiname import IWikiName
10 from lp.code.interfaces.seriessourcepackagebranch import (
11 IMakeOfficialBranchLinks, ISeriesSourcePackageBranch)
12 from lp.registry.interfaces.sourcepackage import ISourcePackage
13@@ -2234,6 +2236,14 @@
14 account)
15
16
17+class ViewIrcID(AnonymousAuthorization):
18+ usedfor = IIrcID
19+
20+
21+class ViewWikiName(AnonymousAuthorization):
22+ usedfor = IWikiName
23+
24+
25 class EditArchivePermissionSet(AuthorizationBase):
26 permission = 'launchpad.Edit'
27 usedfor = IArchivePermissionSet
28
29=== modified file 'lib/lp/registry/stories/webservice/xx-person.txt'
30--- lib/lp/registry/stories/webservice/xx-person.txt 2010-02-24 16:53:30 +0000
31+++ lib/lp/registry/stories/webservice/xx-person.txt 2010-03-12 09:09:18 +0000
32@@ -371,6 +371,11 @@
33 >>> print_self_link_of_entries(webservice.get(wikis_link).jsonBody())
34 http://.../~salgado/+wikiname/2
35
36+They can be listed by anonymous clients.
37+
38+ >>> print_self_link_of_entries(anon_webservice.get(wikis_link).jsonBody())
39+ http://.../~salgado/+wikiname/2
40+
41 Wiki names are first-class objects with their own URLs and
42 representations too.
43
44@@ -457,6 +462,11 @@
45 >>> print_self_link_of_entries(webservice.get(irc_ids_link).jsonBody())
46 http://.../~mark/+ircnick/1
47
48+Anonymous listing is possible.
49+
50+ >>> print_self_link_of_entries(anon_webservice.get(irc_ids_link).jsonBody())
51+ http://.../~mark/+ircnick/1
52+
53 IRC IDs are first-class objects with their own URLs and representations
54 too.
55