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
=== modified file 'lib/canonical/launchpad/security.py'
--- lib/canonical/launchpad/security.py 2010-03-10 23:20:31 +0000
+++ lib/canonical/launchpad/security.py 2010-03-12 09:09:18 +0000
@@ -86,6 +86,8 @@
86from lp.registry.interfaces.productseries import IProductSeries86from lp.registry.interfaces.productseries import IProductSeries
87from lp.registry.interfaces.projectgroup import (87from lp.registry.interfaces.projectgroup import (
88 IProjectGroup, IProjectGroupSet)88 IProjectGroup, IProjectGroupSet)
89from lp.registry.interfaces.irc import IIrcID
90from lp.registry.interfaces.wikiname import IWikiName
89from lp.code.interfaces.seriessourcepackagebranch import (91from lp.code.interfaces.seriessourcepackagebranch import (
90 IMakeOfficialBranchLinks, ISeriesSourcePackageBranch)92 IMakeOfficialBranchLinks, ISeriesSourcePackageBranch)
91from lp.registry.interfaces.sourcepackage import ISourcePackage93from lp.registry.interfaces.sourcepackage import ISourcePackage
@@ -2234,6 +2236,14 @@
2234 account)2236 account)
22352237
22362238
2239class ViewIrcID(AnonymousAuthorization):
2240 usedfor = IIrcID
2241
2242
2243class ViewWikiName(AnonymousAuthorization):
2244 usedfor = IWikiName
2245
2246
2237class EditArchivePermissionSet(AuthorizationBase):2247class EditArchivePermissionSet(AuthorizationBase):
2238 permission = 'launchpad.Edit'2248 permission = 'launchpad.Edit'
2239 usedfor = IArchivePermissionSet2249 usedfor = IArchivePermissionSet
22402250
=== modified file 'lib/lp/registry/stories/webservice/xx-person.txt'
--- lib/lp/registry/stories/webservice/xx-person.txt 2010-02-24 16:53:30 +0000
+++ lib/lp/registry/stories/webservice/xx-person.txt 2010-03-12 09:09:18 +0000
@@ -371,6 +371,11 @@
371 >>> print_self_link_of_entries(webservice.get(wikis_link).jsonBody())371 >>> print_self_link_of_entries(webservice.get(wikis_link).jsonBody())
372 http://.../~salgado/+wikiname/2372 http://.../~salgado/+wikiname/2
373373
374They can be listed by anonymous clients.
375
376 >>> print_self_link_of_entries(anon_webservice.get(wikis_link).jsonBody())
377 http://.../~salgado/+wikiname/2
378
374Wiki names are first-class objects with their own URLs and379Wiki names are first-class objects with their own URLs and
375representations too.380representations too.
376381
@@ -457,6 +462,11 @@
457 >>> print_self_link_of_entries(webservice.get(irc_ids_link).jsonBody())462 >>> print_self_link_of_entries(webservice.get(irc_ids_link).jsonBody())
458 http://.../~mark/+ircnick/1463 http://.../~mark/+ircnick/1
459464
465Anonymous listing is possible.
466
467 >>> print_self_link_of_entries(anon_webservice.get(irc_ids_link).jsonBody())
468 http://.../~mark/+ircnick/1
469
460IRC IDs are first-class objects with their own URLs and representations470IRC IDs are first-class objects with their own URLs and representations
461too.471too.
462472