Merge lp:~edwin-grubbs/launchpad/bug-451208-subscribing-reveals-email into lp:launchpad
- bug-451208-subscribing-reveals-email
- Merge into devel
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~edwin-grubbs/launchpad/bug-451208-subscribing-reveals-email |
Merge into: | lp:launchpad |
Diff against target: |
1808 lines (+788/-258) 16 files modified
lib/canonical/launchpad/browser/vocabulary.py (+5/-1) lib/canonical/launchpad/doc/vocabularies.txt (+8/-5) lib/canonical/launchpad/doc/vocabulary-json.txt (+20/-0) lib/canonical/launchpad/vocabularies/configure.zcml (+297/-86) lib/canonical/launchpad/vocabularies/dbobjects.py (+5/-3) lib/canonical/launchpad/webapp/configure.zcml (+1/-0) lib/canonical/launchpad/webapp/metazcml.py (+7/-2) lib/canonical/launchpad/zcml/binaryandsourcepackagename.zcml (+13/-2) lib/lp/answers/configure.zcml (+9/-2) lib/lp/answers/doc/faq-vocabulary.txt (+2/-1) lib/lp/registry/doc/vocabularies.txt (+57/-56) lib/lp/registry/vocabularies.zcml (+304/-95) lib/lp/services/tests/test_vocabularies.py (+37/-0) lib/lp/services/worlddata/vocabularies.zcml (+5/-2) lib/lp/soyuz/configure.zcml (+16/-2) lib/lp/soyuz/interfaces/binarypackagename.py (+2/-1) |
To merge this branch: | bzr merge lp:~edwin-grubbs/launchpad/bug-451208-subscribing-reveals-email |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Guilherme Salgado (community) | code | Approve | |
Canonical Launchpad Engineering | code | Pending | |
Review via email: mp+17261@code.launchpad.net |
Commit message
Description of the change
Edwin Grubbs (edwin-grubbs) wrote : | # |
Guilherme Salgado (salgado) wrote : | # |
> === modified file 'lib/canonical/
> --- lib/canonical/
> +++ lib/canonical/
> @@ -809,6 +809,7 @@
>
> <class class="
> <allow interface=
> + <allow attributes=
Wouldn't it make sense to add __getslice__ to CountableIterator?
> </class>
>
> <class class="
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -20,7 +20,9 @@
> The active mailing lists vocabulary matches and returns only those mailing
> lists which are active.
>
> - >>> list_vocabulary = vocabulary_
> + >>> from zope.security.proxy import removeSecurityProxy
> + >>> list_vocabulary = removeSecurityP
> + ... vocabulary_
> >>> from canonical.
> >>> from canonical.
> >>> verifyObject(
> @@ -203,6 +205,7 @@
> u'The Hoary Hedgehog Release'
>
> >>> def getTerms(vocab, search_text):
> + ... vocab = removeSecurityP
> ... [vocab.toTerm(item) for item in vocab.search(
>
> >>> getTerms(
> @@ -508,7 +511,8 @@
>
> The list of selectable projects. The results are ordered by displayname.
>
> - >>> project_vocabulary = vocabulary_
> + >>> project_vocabulary = removeSecurityP
> + ... vocabulary_
I think we wought to have a wrapper around vocabulary_
the security proxy of the vocab before returning. Something like
def get_naked_
return removeSecurityP
That way we don't have to repeat the removeSecurityP
places we call vocabulary_
> >>> project_
> 'Select a project group'
>
> @@ -542,7 +546,8 @@
>
> The list of selectable products. Results are ordered by displayname.
>
> - >>> product_vocabulary = vocabulary_
> + >>> product_vocabulary = removeSecurityP
> + ... vocabulary_
> >>> product_
> 'Select a project'
>
> @@ -583,8 +588,8 @@
>
> The list of selectable products releases.
>
> - >>> productrelease_
> - ... "ProductRelease")
> + >>> productrelease_
> + ... vocabulary_
> >>> productrelease_
Guilherme Salgado (salgado) wrote : | # |
> === modified file 'lib/canonical/
> --- lib/canonical/
> +++ lib/canonical/
> @@ -809,6 +809,7 @@
>
> <class class="
> <allow interface=
> + <allow attributes=
Wouldn't it make sense to add __getslice__ to CountableIterator?
> </class>
>
> <class class="
>
> === modified file 'lib/lp/
> --- lib/lp/
> +++ lib/lp/
> @@ -20,7 +20,9 @@
> The active mailing lists vocabulary matches and returns only those mailing
> lists which are active.
>
> - >>> list_vocabulary = vocabulary_
> + >>> from zope.security.proxy import removeSecurityProxy
> + >>> list_vocabulary = removeSecurityP
> + ... vocabulary_
> >>> from canonical.
> >>> from canonical.
> >>> verifyObject(
> @@ -203,6 +205,7 @@
> u'The Hoary Hedgehog Release'
>
> >>> def getTerms(vocab, search_text):
> + ... vocab = removeSecurityP
> ... [vocab.toTerm(item) for item in vocab.search(
>
> >>> getTerms(
> @@ -508,7 +511,8 @@
>
> The list of selectable projects. The results are ordered by displayname.
>
> - >>> project_vocabulary = vocabulary_
> + >>> project_vocabulary = removeSecurityP
> + ... vocabulary_
I think we wought to have a wrapper around vocabulary_
the security proxy of the vocab before returning. Something like
def get_naked_
return removeSecurityP
That way we don't have to repeat the removeSecurityP
places we call vocabulary_
> >>> project_
> 'Select a project group'
>
> @@ -542,7 +546,8 @@
>
> The list of selectable products. Results are ordered by displayname.
>
> - >>> product_vocabulary = vocabulary_
> + >>> product_vocabulary = removeSecurityP
> + ... vocabulary_
> >>> product_
> 'Select a project'
>
> @@ -583,8 +588,8 @@
>
> The list of selectable products releases.
>
> - >>> productrelease_
> - ... "ProductRelease")
> + >>> productrelease_
> + ... vocabulary_
> >>> productrelease_
Edwin Grubbs (edwin-grubbs) wrote : | # |
> > === modified file 'lib/canonical/
> > --- lib/canonical/
> +0000
> > +++ lib/canonical/
> +0000
> > @@ -809,6 +809,7 @@
> >
> > <class class="
> > <allow
> interface=
> > + <allow attributes=
>
> Wouldn't it make sense to add __getslice__ to CountableIterator?
Gary had recommended that I add __getslice__ to the zcml instead of the interface
since this is a security concern and not a method that implementors of ICountableIterator
need to create.
> > </class>
> >
> > <class
> class="
> >
> > === modified file 'lib/lp/
> > --- lib/lp/
> > +++ lib/lp/
> > @@ -20,7 +20,9 @@
> > The active mailing lists vocabulary matches and returns only those mailing
> > lists which are active.
> >
> > - >>> list_vocabulary = vocabulary_
> 'ActiveMailingL
> > + >>> from zope.security.proxy import removeSecurityProxy
> > + >>> list_vocabulary = removeSecurityP
> > + ... vocabulary_
> > >>> from canonical.
> > >>> from canonical.
> > >>> verifyObject(
> > @@ -203,6 +205,7 @@
> > u'The Hoary Hedgehog Release'
> >
> > >>> def getTerms(vocab, search_text):
> > + ... vocab = removeSecurityP
> > ... [vocab.toTerm(item) for item in vocab.search(
> >
> > >>> getTerms(
> > @@ -508,7 +511,8 @@
> >
> > The list of selectable projects. The results are ordered by displayname.
> >
> > - >>> project_vocabulary = vocabulary_
> > + >>> project_vocabulary = removeSecurityP
> > + ... vocabulary_
>
> I think we wought to have a wrapper around vocabulary_
> the security proxy of the vocab before returning. Something like
>
> def get_naked_
> return removeSecurityP
>
> That way we don't have to repeat the removeSecurityP
> places we call vocabulary_
Done.
> > >>> project_
> > 'Select a project group'
> >
> > @@ -542,7 +546,8 @@
> >
> > The list of selectable products. Results are ordered by displayname.
> >
> > - >>> product_vocabulary = vocabulary_
> > + >>> product_vocabulary = removeSecurityP
> > + ... vocabulary_
> > >>> product_
> > 'Select a project'
> >
> > @@ -583,8 +588,8 @@
> >
> > The list of sel...
Guilherme Salgado (salgado) wrote : | # |
Just add a comment explaining why we need the "vocab.
Preview Diff
1 | === modified file 'lib/canonical/launchpad/browser/vocabulary.py' | |||
2 | --- lib/canonical/launchpad/browser/vocabulary.py 2010-01-11 17:47:52 +0000 | |||
3 | +++ lib/canonical/launchpad/browser/vocabulary.py 2010-01-18 21:51:20 +0000 | |||
4 | @@ -23,6 +23,7 @@ | |||
5 | 23 | from zope.component.interfaces import ComponentLookupError | 23 | from zope.component.interfaces import ComponentLookupError |
6 | 24 | from zope.interface import Attribute, implements, Interface | 24 | from zope.interface import Attribute, implements, Interface |
7 | 25 | from zope.app.form.interfaces import MissingInputError | 25 | from zope.app.form.interfaces import MissingInputError |
8 | 26 | from zope.security.interfaces import Unauthorized | ||
9 | 26 | 27 | ||
10 | 27 | from lazr.restful.interfaces import IWebServiceClientRequest | 28 | from lazr.restful.interfaces import IWebServiceClientRequest |
11 | 28 | 29 | ||
12 | @@ -83,7 +84,10 @@ | |||
13 | 83 | """Adapts IPerson to IPickerEntry.""" | 84 | """Adapts IPerson to IPickerEntry.""" |
14 | 84 | extra = default_pickerentry_adapter(person) | 85 | extra = default_pickerentry_adapter(person) |
15 | 85 | if person.preferredemail is not None: | 86 | if person.preferredemail is not None: |
17 | 86 | extra.description = person.preferredemail.email | 87 | try: |
18 | 88 | extra.description = person.preferredemail.email | ||
19 | 89 | except Unauthorized: | ||
20 | 90 | extra.description = '<email address hidden>' | ||
21 | 87 | return extra | 91 | return extra |
22 | 88 | 92 | ||
23 | 89 | @implementer(IPickerEntry) | 93 | @implementer(IPickerEntry) |
24 | 90 | 94 | ||
25 | === modified file 'lib/canonical/launchpad/doc/vocabularies.txt' | |||
26 | --- lib/canonical/launchpad/doc/vocabularies.txt 2009-10-26 18:40:04 +0000 | |||
27 | +++ lib/canonical/launchpad/doc/vocabularies.txt 2010-01-18 21:51:20 +0000 | |||
28 | @@ -43,7 +43,11 @@ | |||
29 | 43 | vocabulary registry. | 43 | vocabulary registry. |
30 | 44 | 44 | ||
31 | 45 | >>> from zope.schema.vocabulary import getVocabularyRegistry | 45 | >>> from zope.schema.vocabulary import getVocabularyRegistry |
32 | 46 | >>> from zope.security.proxy import removeSecurityProxy | ||
33 | 46 | >>> vocabulary_registry = getVocabularyRegistry() | 47 | >>> vocabulary_registry = getVocabularyRegistry() |
34 | 48 | >>> def get_naked_vocab(context, name): | ||
35 | 49 | ... return removeSecurityProxy( | ||
36 | 50 | ... vocabulary_registry.get(context, name)) | ||
37 | 47 | >>> product_vocabulary = vocabulary_registry.get(None, "Product") | 51 | >>> product_vocabulary = vocabulary_registry.get(None, "Product") |
38 | 48 | >>> product_vocabulary.displayname | 52 | >>> product_vocabulary.displayname |
39 | 49 | 'Select a project' | 53 | 'Select a project' |
40 | @@ -56,7 +60,7 @@ | |||
41 | 56 | 60 | ||
42 | 57 | All the distributions that use Malone as their main bug tracker. | 61 | All the distributions that use Malone as their main bug tracker. |
43 | 58 | 62 | ||
45 | 59 | >>> using_malone_vocabulary = vocabulary_registry.get( | 63 | >>> using_malone_vocabulary = get_naked_vocab( |
46 | 60 | ... None, 'DistributionUsingMalone') | 64 | ... None, 'DistributionUsingMalone') |
47 | 61 | >>> len(using_malone_vocabulary) | 65 | >>> len(using_malone_vocabulary) |
48 | 62 | 2 | 66 | 2 |
49 | @@ -358,7 +362,7 @@ | |||
50 | 358 | concerned). | 362 | concerned). |
51 | 359 | 363 | ||
52 | 360 | # Just use None as the context. | 364 | # Just use None as the context. |
54 | 361 | >>> branch_vocabulary = vocabulary_registry.get(None, "Branch") | 365 | >>> branch_vocabulary = get_naked_vocab(None, "Branch") |
55 | 362 | >>> def print_vocab_branches(vocab, search): | 366 | >>> def print_vocab_branches(vocab, search): |
56 | 363 | ... for term in vocab.searchForTerms(search): | 367 | ... for term in vocab.searchForTerms(search): |
57 | 364 | ... print term.value.unique_name | 368 | ... print term.value.unique_name |
58 | @@ -639,8 +643,7 @@ | |||
59 | 639 | that matches the search string. The string is matched against the name, | 643 | that matches the search string. The string is matched against the name, |
60 | 640 | or fallbacks to a full text search. | 644 | or fallbacks to a full text search. |
61 | 641 | 645 | ||
64 | 642 | >>> vocab = vocabulary_registry.get( | 646 | >>> vocab = get_naked_vocab(spec_a, "SpecificationDepCandidates") |
63 | 643 | ... spec_a, "SpecificationDepCandidates") | ||
65 | 644 | >>> list(vocab.search('spec-b')) == [spec_b] | 647 | >>> list(vocab.search('spec-b')) == [spec_b] |
66 | 645 | True | 648 | True |
67 | 646 | >>> list(vocab.search('third')) == [spec_c] | 649 | >>> list(vocab.search('third')) == [spec_c] |
68 | @@ -664,7 +667,7 @@ | |||
69 | 664 | >>> from canonical.launchpad.webapp.testing import verifyObject | 667 | >>> from canonical.launchpad.webapp.testing import verifyObject |
70 | 665 | >>> from canonical.launchpad.webapp.vocabulary import IHugeVocabulary | 668 | >>> from canonical.launchpad.webapp.vocabulary import IHugeVocabulary |
71 | 666 | 669 | ||
73 | 667 | >>> vocabulary = vocabulary_registry.get(None, 'PPA') | 670 | >>> vocabulary = get_naked_vocab(None, 'PPA') |
74 | 668 | >>> verifyObject(IHugeVocabulary, vocabulary) | 671 | >>> verifyObject(IHugeVocabulary, vocabulary) |
75 | 669 | True | 672 | True |
76 | 670 | 673 | ||
77 | 671 | 674 | ||
78 | === modified file 'lib/canonical/launchpad/doc/vocabulary-json.txt' | |||
79 | --- lib/canonical/launchpad/doc/vocabulary-json.txt 2009-07-28 13:48:07 +0000 | |||
80 | +++ lib/canonical/launchpad/doc/vocabulary-json.txt 2010-01-18 21:51:20 +0000 | |||
81 | @@ -121,3 +121,23 @@ | |||
82 | 121 | ], | 121 | ], |
83 | 122 | "total_size": 1 | 122 | "total_size": 1 |
84 | 123 | } | 123 | } |
85 | 124 | |||
86 | 125 | Hidden email addresses should also be hidden when IPerson objects are | ||
87 | 126 | retrieved through vocabularies. | ||
88 | 127 | |||
89 | 128 | >>> form = dict(name='ValidPersonOrTeam', search_text='name12', | ||
90 | 129 | ... start='0', batch='1') | ||
91 | 130 | >>> view = create_vocabulary_view(form) | ||
92 | 131 | >>> print_json(view()) | ||
93 | 132 | { | ||
94 | 133 | "entries": [ | ||
95 | 134 | { | ||
96 | 135 | "api_uri": "/~name12", | ||
97 | 136 | "css": "sprite person", | ||
98 | 137 | "description": "<email address hidden>", | ||
99 | 138 | "title": "Sample Person", | ||
100 | 139 | "value": "name12" | ||
101 | 140 | } | ||
102 | 141 | ], | ||
103 | 142 | "total_size": 1 | ||
104 | 143 | } | ||
105 | 124 | 144 | ||
106 | === modified file 'lib/canonical/launchpad/vocabularies/configure.zcml' | |||
107 | --- lib/canonical/launchpad/vocabularies/configure.zcml 2009-10-26 18:40:04 +0000 | |||
108 | +++ lib/canonical/launchpad/vocabularies/configure.zcml 2010-01-18 21:51:20 +0000 | |||
109 | @@ -4,177 +4,388 @@ | |||
110 | 4 | 4 | ||
111 | 5 | <configure xmlns="http://namespaces.zope.org/zope"> | 5 | <configure xmlns="http://namespaces.zope.org/zope"> |
112 | 6 | 6 | ||
114 | 7 | <utility | 7 | <class class="zope.schema.vocabulary.SimpleVocabulary"> |
115 | 8 | <allow interface="zope.schema.interfaces.IVocabularyTokenized"/> | ||
116 | 9 | </class> | ||
117 | 10 | |||
118 | 11 | <class class="zope.schema.vocabulary.SimpleTerm"> | ||
119 | 12 | <allow interface="zope.schema.interfaces.ITitledTokenizedTerm"/> | ||
120 | 13 | </class> | ||
121 | 14 | |||
122 | 15 | <securedutility | ||
123 | 8 | name="Branch" | 16 | name="Branch" |
124 | 9 | component="canonical.launchpad.vocabularies.BranchVocabulary" | 17 | component="canonical.launchpad.vocabularies.BranchVocabulary" |
125 | 10 | provides="zope.schema.interfaces.IVocabularyFactory" | 18 | provides="zope.schema.interfaces.IVocabularyFactory" |
129 | 11 | /> | 19 | > |
130 | 12 | 20 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
131 | 13 | <utility | 21 | </securedutility> |
132 | 22 | |||
133 | 23 | <class class="canonical.launchpad.vocabularies.BranchVocabulary"> | ||
134 | 24 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
135 | 25 | </class> | ||
136 | 26 | |||
137 | 27 | |||
138 | 28 | <securedutility | ||
139 | 14 | name="HostedBranchRestrictedOnOwner" | 29 | name="HostedBranchRestrictedOnOwner" |
140 | 15 | component="canonical.launchpad.vocabularies.HostedBranchRestrictedOnOwnerVocabulary" | 30 | component="canonical.launchpad.vocabularies.HostedBranchRestrictedOnOwnerVocabulary" |
141 | 16 | provides="zope.schema.interfaces.IVocabularyFactory" | 31 | provides="zope.schema.interfaces.IVocabularyFactory" |
145 | 17 | /> | 32 | > |
146 | 18 | 33 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
147 | 19 | <utility | 34 | </securedutility> |
148 | 35 | |||
149 | 36 | <class class="canonical.launchpad.vocabularies.HostedBranchRestrictedOnOwnerVocabulary"> | ||
150 | 37 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
151 | 38 | </class> | ||
152 | 39 | |||
153 | 40 | |||
154 | 41 | <securedutility | ||
155 | 20 | name="BranchRestrictedOnProduct" | 42 | name="BranchRestrictedOnProduct" |
156 | 21 | component="canonical.launchpad.vocabularies.BranchRestrictedOnProductVocabulary" | 43 | component="canonical.launchpad.vocabularies.BranchRestrictedOnProductVocabulary" |
157 | 22 | provides="zope.schema.interfaces.IVocabularyFactory" | 44 | provides="zope.schema.interfaces.IVocabularyFactory" |
161 | 23 | /> | 45 | > |
162 | 24 | 46 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
163 | 25 | <utility | 47 | </securedutility> |
164 | 48 | |||
165 | 49 | <class class="canonical.launchpad.vocabularies.BranchRestrictedOnProductVocabulary"> | ||
166 | 50 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
167 | 51 | </class> | ||
168 | 52 | |||
169 | 53 | |||
170 | 54 | <securedutility | ||
171 | 26 | name="Bug" | 55 | name="Bug" |
172 | 27 | component="canonical.launchpad.vocabularies.BugVocabulary" | 56 | component="canonical.launchpad.vocabularies.BugVocabulary" |
173 | 28 | provides="zope.schema.interfaces.IVocabularyFactory" | 57 | provides="zope.schema.interfaces.IVocabularyFactory" |
177 | 29 | /> | 58 | > |
178 | 30 | 59 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
179 | 31 | <utility | 60 | </securedutility> |
180 | 61 | |||
181 | 62 | <class class="canonical.launchpad.vocabularies.BugVocabulary"> | ||
182 | 63 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
183 | 64 | </class> | ||
184 | 65 | |||
185 | 66 | |||
186 | 67 | <securedutility | ||
187 | 32 | name="BugNominatableSeries" | 68 | name="BugNominatableSeries" |
188 | 33 | component="canonical.launchpad.vocabularies.BugNominatableSeriesVocabulary" | 69 | component="canonical.launchpad.vocabularies.BugNominatableSeriesVocabulary" |
189 | 34 | provides="zope.schema.interfaces.IVocabularyFactory" | 70 | provides="zope.schema.interfaces.IVocabularyFactory" |
193 | 35 | /> | 71 | > |
194 | 36 | 72 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
195 | 37 | <utility | 73 | </securedutility> |
196 | 74 | |||
197 | 75 | <class class="canonical.launchpad.vocabularies.BugNominatableProductSeriesVocabulary"> | ||
198 | 76 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
199 | 77 | </class> | ||
200 | 78 | |||
201 | 79 | <class class="canonical.launchpad.vocabularies.BugNominatableDistroSeriesVocabulary"> | ||
202 | 80 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
203 | 81 | </class> | ||
204 | 82 | |||
205 | 83 | |||
206 | 84 | <securedutility | ||
207 | 38 | name="BugTracker" | 85 | name="BugTracker" |
208 | 39 | component="canonical.launchpad.vocabularies.BugTrackerVocabulary" | 86 | component="canonical.launchpad.vocabularies.BugTrackerVocabulary" |
209 | 40 | provides="zope.schema.interfaces.IVocabularyFactory" | 87 | provides="zope.schema.interfaces.IVocabularyFactory" |
213 | 41 | /> | 88 | > |
214 | 42 | 89 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
215 | 43 | <utility | 90 | </securedutility> |
216 | 91 | |||
217 | 92 | <class class="canonical.launchpad.vocabularies.BugTrackerVocabulary"> | ||
218 | 93 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
219 | 94 | </class> | ||
220 | 95 | |||
221 | 96 | |||
222 | 97 | <securedutility | ||
223 | 44 | name="BugWatch" | 98 | name="BugWatch" |
224 | 45 | component="canonical.launchpad.vocabularies.BugWatchVocabulary" | 99 | component="canonical.launchpad.vocabularies.BugWatchVocabulary" |
225 | 46 | provides="zope.schema.interfaces.IVocabularyFactory" | 100 | provides="zope.schema.interfaces.IVocabularyFactory" |
229 | 47 | /> | 101 | > |
230 | 48 | 102 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
231 | 49 | <utility | 103 | </securedutility> |
232 | 104 | |||
233 | 105 | <class class="canonical.launchpad.vocabularies.BugWatchVocabulary"> | ||
234 | 106 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
235 | 107 | </class> | ||
236 | 108 | |||
237 | 109 | |||
238 | 110 | <securedutility | ||
239 | 50 | name="Component" | 111 | name="Component" |
240 | 51 | component="canonical.launchpad.vocabularies.ComponentVocabulary" | 112 | component="canonical.launchpad.vocabularies.ComponentVocabulary" |
241 | 52 | provides="zope.schema.interfaces.IVocabularyFactory" | 113 | provides="zope.schema.interfaces.IVocabularyFactory" |
245 | 53 | /> | 114 | > |
246 | 54 | 115 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
247 | 55 | <utility | 116 | </securedutility> |
248 | 117 | |||
249 | 118 | <class class="canonical.launchpad.vocabularies.ComponentVocabulary"> | ||
250 | 119 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
251 | 120 | </class> | ||
252 | 121 | |||
253 | 122 | |||
254 | 123 | <securedutility | ||
255 | 56 | name="CountryName" | 124 | name="CountryName" |
256 | 57 | component="canonical.launchpad.vocabularies.CountryNameVocabulary" | 125 | component="canonical.launchpad.vocabularies.CountryNameVocabulary" |
257 | 58 | provides="zope.schema.interfaces.IVocabularyFactory" | 126 | provides="zope.schema.interfaces.IVocabularyFactory" |
261 | 59 | /> | 127 | > |
262 | 60 | 128 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
263 | 61 | <utility | 129 | </securedutility> |
264 | 130 | |||
265 | 131 | <class class="canonical.launchpad.vocabularies.CountryNameVocabulary"> | ||
266 | 132 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
267 | 133 | </class> | ||
268 | 134 | |||
269 | 135 | |||
270 | 136 | <securedutility | ||
271 | 62 | name="DistributionUsingMalone" | 137 | name="DistributionUsingMalone" |
272 | 63 | component="canonical.launchpad.vocabularies.DistributionUsingMaloneVocabulary" | 138 | component="canonical.launchpad.vocabularies.DistributionUsingMaloneVocabulary" |
273 | 64 | provides="zope.schema.interfaces.IVocabularyFactory" | 139 | provides="zope.schema.interfaces.IVocabularyFactory" |
277 | 65 | /> | 140 | > |
278 | 66 | 141 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
279 | 67 | <utility | 142 | </securedutility> |
280 | 143 | |||
281 | 144 | <class class="canonical.launchpad.vocabularies.DistributionUsingMaloneVocabulary"> | ||
282 | 145 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
283 | 146 | </class> | ||
284 | 147 | |||
285 | 148 | |||
286 | 149 | <securedutility | ||
287 | 68 | name="FilteredDeltaLanguagePack" | 150 | name="FilteredDeltaLanguagePack" |
288 | 69 | component="canonical.launchpad.vocabularies.FilteredDeltaLanguagePackVocabulary" | 151 | component="canonical.launchpad.vocabularies.FilteredDeltaLanguagePackVocabulary" |
289 | 70 | provides="zope.schema.interfaces.IVocabularyFactory" | 152 | provides="zope.schema.interfaces.IVocabularyFactory" |
293 | 71 | /> | 153 | > |
294 | 72 | 154 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
295 | 73 | <utility | 155 | </securedutility> |
296 | 156 | |||
297 | 157 | <class class="canonical.launchpad.vocabularies.FilteredDeltaLanguagePackVocabulary"> | ||
298 | 158 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
299 | 159 | </class> | ||
300 | 160 | |||
301 | 161 | |||
302 | 162 | <securedutility | ||
303 | 74 | name="FilteredDistroArchSeries" | 163 | name="FilteredDistroArchSeries" |
304 | 75 | component="canonical.launchpad.vocabularies.FilteredDistroArchSeriesVocabulary" | 164 | component="canonical.launchpad.vocabularies.FilteredDistroArchSeriesVocabulary" |
305 | 76 | provides="zope.schema.interfaces.IVocabularyFactory" | 165 | provides="zope.schema.interfaces.IVocabularyFactory" |
309 | 77 | /> | 166 | > |
310 | 78 | 167 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
311 | 79 | <utility | 168 | </securedutility> |
312 | 169 | |||
313 | 170 | <class class="canonical.launchpad.vocabularies.FilteredDistroArchSeriesVocabulary"> | ||
314 | 171 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
315 | 172 | </class> | ||
316 | 173 | |||
317 | 174 | |||
318 | 175 | <securedutility | ||
319 | 80 | name="FilteredFullLanguagePack" | 176 | name="FilteredFullLanguagePack" |
320 | 81 | component="canonical.launchpad.vocabularies.FilteredFullLanguagePackVocabulary" | 177 | component="canonical.launchpad.vocabularies.FilteredFullLanguagePackVocabulary" |
321 | 82 | provides="zope.schema.interfaces.IVocabularyFactory" | 178 | provides="zope.schema.interfaces.IVocabularyFactory" |
325 | 83 | /> | 179 | > |
326 | 84 | 180 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
327 | 85 | <utility | 181 | </securedutility> |
328 | 182 | |||
329 | 183 | <class class="canonical.launchpad.vocabularies.FilteredFullLanguagePackVocabulary"> | ||
330 | 184 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
331 | 185 | </class> | ||
332 | 186 | |||
333 | 187 | |||
334 | 188 | <securedutility | ||
335 | 86 | name="FilteredLanguagePack" | 189 | name="FilteredLanguagePack" |
336 | 87 | component="canonical.launchpad.vocabularies.FilteredLanguagePackVocabulary" | 190 | component="canonical.launchpad.vocabularies.FilteredLanguagePackVocabulary" |
337 | 88 | provides="zope.schema.interfaces.IVocabularyFactory" | 191 | provides="zope.schema.interfaces.IVocabularyFactory" |
341 | 89 | /> | 192 | > |
342 | 90 | 193 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
343 | 91 | <utility | 194 | </securedutility> |
344 | 195 | |||
345 | 196 | <class class="canonical.launchpad.vocabularies.FilteredLanguagePackVocabulary"> | ||
346 | 197 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
347 | 198 | </class> | ||
348 | 199 | |||
349 | 200 | |||
350 | 201 | <securedutility | ||
351 | 92 | name="FutureSprint" | 202 | name="FutureSprint" |
352 | 93 | component="canonical.launchpad.vocabularies.FutureSprintVocabulary" | 203 | component="canonical.launchpad.vocabularies.FutureSprintVocabulary" |
353 | 94 | provides="zope.schema.interfaces.IVocabularyFactory" | 204 | provides="zope.schema.interfaces.IVocabularyFactory" |
357 | 95 | /> | 205 | > |
358 | 96 | 206 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
359 | 97 | <utility | 207 | </securedutility> |
360 | 208 | |||
361 | 209 | <class class="canonical.launchpad.vocabularies.FutureSprintVocabulary"> | ||
362 | 210 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
363 | 211 | </class> | ||
364 | 212 | |||
365 | 213 | |||
366 | 214 | <securedutility | ||
367 | 98 | name="Language" | 215 | name="Language" |
368 | 99 | component="canonical.launchpad.vocabularies.LanguageVocabulary" | 216 | component="canonical.launchpad.vocabularies.LanguageVocabulary" |
369 | 100 | provides="zope.schema.interfaces.IVocabularyFactory" | 217 | provides="zope.schema.interfaces.IVocabularyFactory" |
373 | 101 | /> | 218 | > |
374 | 102 | 219 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
375 | 103 | <utility | 220 | </securedutility> |
376 | 221 | |||
377 | 222 | <class class="canonical.launchpad.vocabularies.LanguageVocabulary"> | ||
378 | 223 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
379 | 224 | </class> | ||
380 | 225 | |||
381 | 226 | |||
382 | 227 | <securedutility | ||
383 | 104 | name="TranslatableLanguage" | 228 | name="TranslatableLanguage" |
384 | 105 | component="canonical.launchpad.vocabularies.TranslatableLanguageVocabulary" | 229 | component="canonical.launchpad.vocabularies.TranslatableLanguageVocabulary" |
385 | 106 | provides="zope.schema.interfaces.IVocabularyFactory" | 230 | provides="zope.schema.interfaces.IVocabularyFactory" |
389 | 107 | /> | 231 | > |
390 | 108 | 232 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
391 | 109 | <utility | 233 | </securedutility> |
392 | 234 | |||
393 | 235 | <class class="canonical.launchpad.vocabularies.TranslatableLanguageVocabulary"> | ||
394 | 236 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
395 | 237 | </class> | ||
396 | 238 | |||
397 | 239 | |||
398 | 240 | <securedutility | ||
399 | 110 | name="PackageRelease" | 241 | name="PackageRelease" |
400 | 111 | component="canonical.launchpad.vocabularies.PackageReleaseVocabulary" | 242 | component="canonical.launchpad.vocabularies.PackageReleaseVocabulary" |
401 | 112 | provides="zope.schema.interfaces.IVocabularyFactory" | 243 | provides="zope.schema.interfaces.IVocabularyFactory" |
405 | 113 | /> | 244 | > |
406 | 114 | 245 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
407 | 115 | <utility | 246 | </securedutility> |
408 | 247 | |||
409 | 248 | <class class="canonical.launchpad.vocabularies.PackageReleaseVocabulary"> | ||
410 | 249 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
411 | 250 | </class> | ||
412 | 251 | |||
413 | 252 | |||
414 | 253 | <securedutility | ||
415 | 116 | name="PPA" | 254 | name="PPA" |
416 | 117 | component="canonical.launchpad.vocabularies.PPAVocabulary" | 255 | component="canonical.launchpad.vocabularies.PPAVocabulary" |
417 | 118 | provides="zope.schema.interfaces.IVocabularyFactory" | 256 | provides="zope.schema.interfaces.IVocabularyFactory" |
421 | 119 | /> | 257 | > |
422 | 120 | 258 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
423 | 121 | <utility | 259 | </securedutility> |
424 | 260 | |||
425 | 261 | <class class="canonical.launchpad.vocabularies.PPAVocabulary"> | ||
426 | 262 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
427 | 263 | </class> | ||
428 | 264 | |||
429 | 265 | |||
430 | 266 | <securedutility | ||
431 | 122 | name="ProjectProductsUsingMalone" | 267 | name="ProjectProductsUsingMalone" |
432 | 123 | component="canonical.launchpad.vocabularies.project_products_using_malone_vocabulary_factory" | 268 | component="canonical.launchpad.vocabularies.project_products_using_malone_vocabulary_factory" |
433 | 124 | provides="zope.schema.interfaces.IVocabularyFactory" | 269 | provides="zope.schema.interfaces.IVocabularyFactory" |
437 | 125 | /> | 270 | > |
438 | 126 | 271 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
439 | 127 | <utility | 272 | </securedutility> |
440 | 273 | |||
441 | 274 | |||
442 | 275 | <securedutility | ||
443 | 128 | name="Specification" | 276 | name="Specification" |
444 | 129 | component="canonical.launchpad.vocabularies.SpecificationVocabulary" | 277 | component="canonical.launchpad.vocabularies.SpecificationVocabulary" |
445 | 130 | provides="zope.schema.interfaces.IVocabularyFactory" | 278 | provides="zope.schema.interfaces.IVocabularyFactory" |
449 | 131 | /> | 279 | > |
450 | 132 | 280 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
451 | 133 | <utility | 281 | </securedutility> |
452 | 282 | |||
453 | 283 | <class class="canonical.launchpad.vocabularies.SpecificationVocabulary"> | ||
454 | 284 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
455 | 285 | </class> | ||
456 | 286 | |||
457 | 287 | |||
458 | 288 | <securedutility | ||
459 | 134 | name="SpecificationDependencies" | 289 | name="SpecificationDependencies" |
460 | 135 | component="canonical.launchpad.vocabularies.SpecificationDependenciesVocabulary" | 290 | component="canonical.launchpad.vocabularies.SpecificationDependenciesVocabulary" |
461 | 136 | provides="zope.schema.interfaces.IVocabularyFactory" | 291 | provides="zope.schema.interfaces.IVocabularyFactory" |
465 | 137 | /> | 292 | > |
466 | 138 | 293 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
467 | 139 | <utility | 294 | </securedutility> |
468 | 295 | |||
469 | 296 | <class class="canonical.launchpad.vocabularies.SpecificationDependenciesVocabulary"> | ||
470 | 297 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
471 | 298 | </class> | ||
472 | 299 | |||
473 | 300 | |||
474 | 301 | <securedutility | ||
475 | 140 | name="SpecificationDepCandidates" | 302 | name="SpecificationDepCandidates" |
476 | 141 | component="canonical.launchpad.vocabularies.SpecificationDepCandidatesVocabulary" | 303 | component="canonical.launchpad.vocabularies.SpecificationDepCandidatesVocabulary" |
477 | 142 | provides="zope.schema.interfaces.IVocabularyFactory" | 304 | provides="zope.schema.interfaces.IVocabularyFactory" |
481 | 143 | /> | 305 | > |
482 | 144 | 306 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
483 | 145 | <utility | 307 | </securedutility> |
484 | 308 | |||
485 | 309 | <class class="canonical.launchpad.vocabularies.SpecificationDepCandidatesVocabulary"> | ||
486 | 310 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
487 | 311 | </class> | ||
488 | 312 | |||
489 | 313 | |||
490 | 314 | <securedutility | ||
491 | 146 | name="Sprint" | 315 | name="Sprint" |
492 | 147 | component="canonical.launchpad.vocabularies.SprintVocabulary" | 316 | component="canonical.launchpad.vocabularies.SprintVocabulary" |
493 | 148 | provides="zope.schema.interfaces.IVocabularyFactory" | 317 | provides="zope.schema.interfaces.IVocabularyFactory" |
497 | 149 | /> | 318 | > |
498 | 150 | 319 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
499 | 151 | <utility | 320 | </securedutility> |
500 | 321 | |||
501 | 322 | <class class="canonical.launchpad.vocabularies.SprintVocabulary"> | ||
502 | 323 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
503 | 324 | </class> | ||
504 | 325 | |||
505 | 326 | |||
506 | 327 | <securedutility | ||
507 | 152 | name="TranslationGroup" | 328 | name="TranslationGroup" |
508 | 153 | component="canonical.launchpad.vocabularies.TranslationGroupVocabulary" | 329 | component="canonical.launchpad.vocabularies.TranslationGroupVocabulary" |
509 | 154 | provides="zope.schema.interfaces.IVocabularyFactory" | 330 | provides="zope.schema.interfaces.IVocabularyFactory" |
513 | 155 | /> | 331 | > |
514 | 156 | 332 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
515 | 157 | <utility | 333 | </securedutility> |
516 | 334 | |||
517 | 335 | <class class="canonical.launchpad.vocabularies.TranslationGroupVocabulary"> | ||
518 | 336 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
519 | 337 | </class> | ||
520 | 338 | |||
521 | 339 | |||
522 | 340 | <securedutility | ||
523 | 158 | name="TranslationMessage" | 341 | name="TranslationMessage" |
524 | 159 | component="canonical.launchpad.vocabularies.TranslationMessageVocabulary" | 342 | component="canonical.launchpad.vocabularies.TranslationMessageVocabulary" |
525 | 160 | provides="zope.schema.interfaces.IVocabularyFactory" | 343 | provides="zope.schema.interfaces.IVocabularyFactory" |
529 | 161 | /> | 344 | > |
530 | 162 | 345 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
531 | 163 | <utility | 346 | </securedutility> |
532 | 347 | |||
533 | 348 | <class class="canonical.launchpad.vocabularies.TranslationMessageVocabulary"> | ||
534 | 349 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
535 | 350 | </class> | ||
536 | 351 | |||
537 | 352 | |||
538 | 353 | <securedutility | ||
539 | 164 | name="TranslationTemplate" | 354 | name="TranslationTemplate" |
540 | 165 | component="canonical.launchpad.vocabularies.TranslationTemplateVocabulary" | 355 | component="canonical.launchpad.vocabularies.TranslationTemplateVocabulary" |
541 | 166 | provides="zope.schema.interfaces.IVocabularyFactory" | 356 | provides="zope.schema.interfaces.IVocabularyFactory" |
545 | 167 | /> | 357 | > |
546 | 168 | 358 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
547 | 169 | <utility | 359 | </securedutility> |
548 | 360 | |||
549 | 361 | <class class="canonical.launchpad.vocabularies.TranslationTemplateVocabulary"> | ||
550 | 362 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
551 | 363 | </class> | ||
552 | 364 | |||
553 | 365 | |||
554 | 366 | <securedutility | ||
555 | 170 | name="Processor" | 367 | name="Processor" |
556 | 171 | component="canonical.launchpad.vocabularies.ProcessorVocabulary" | 368 | component="canonical.launchpad.vocabularies.ProcessorVocabulary" |
557 | 172 | provides="zope.schema.interfaces.IVocabularyFactory" | 369 | provides="zope.schema.interfaces.IVocabularyFactory" |
561 | 173 | /> | 370 | > |
562 | 174 | 371 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
563 | 175 | <utility | 372 | </securedutility> |
564 | 373 | |||
565 | 374 | <class class="canonical.launchpad.vocabularies.ProcessorVocabulary"> | ||
566 | 375 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
567 | 376 | </class> | ||
568 | 377 | |||
569 | 378 | |||
570 | 379 | <securedutility | ||
571 | 176 | name="ProcessorFamily" | 380 | name="ProcessorFamily" |
572 | 177 | component="canonical.launchpad.vocabularies.ProcessorFamilyVocabulary" | 381 | component="canonical.launchpad.vocabularies.ProcessorFamilyVocabulary" |
573 | 178 | provides="zope.schema.interfaces.IVocabularyFactory" | 382 | provides="zope.schema.interfaces.IVocabularyFactory" |
575 | 179 | /> | 383 | > |
576 | 384 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | ||
577 | 385 | </securedutility> | ||
578 | 386 | |||
579 | 387 | <class class="canonical.launchpad.vocabularies.ProcessorFamilyVocabulary"> | ||
580 | 388 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
581 | 389 | </class> | ||
582 | 390 | |||
583 | 180 | </configure> | 391 | </configure> |
584 | 181 | 392 | ||
585 | === modified file 'lib/canonical/launchpad/vocabularies/dbobjects.py' | |||
586 | --- lib/canonical/launchpad/vocabularies/dbobjects.py 2009-10-26 18:40:04 +0000 | |||
587 | +++ lib/canonical/launchpad/vocabularies/dbobjects.py 2010-01-18 21:51:20 +0000 | |||
588 | @@ -10,9 +10,10 @@ | |||
589 | 10 | __metaclass__ = type | 10 | __metaclass__ = type |
590 | 11 | 11 | ||
591 | 12 | __all__ = [ | 12 | __all__ = [ |
592 | 13 | 'HostedBranchRestrictedOnOwnerVocabulary', | ||
593 | 14 | 'BranchRestrictedOnProductVocabulary', | 13 | 'BranchRestrictedOnProductVocabulary', |
594 | 15 | 'BranchVocabulary', | 14 | 'BranchVocabulary', |
595 | 15 | 'BugNominatableDistroSeriesVocabulary', | ||
596 | 16 | 'BugNominatableProductSeriesVocabulary', | ||
597 | 16 | 'BugNominatableSeriesVocabulary', | 17 | 'BugNominatableSeriesVocabulary', |
598 | 17 | 'BugTrackerVocabulary', | 18 | 'BugTrackerVocabulary', |
599 | 18 | 'BugVocabulary', | 19 | 'BugVocabulary', |
600 | @@ -25,11 +26,13 @@ | |||
601 | 25 | 'FilteredFullLanguagePackVocabulary', | 26 | 'FilteredFullLanguagePackVocabulary', |
602 | 26 | 'FilteredLanguagePackVocabulary', | 27 | 'FilteredLanguagePackVocabulary', |
603 | 27 | 'FutureSprintVocabulary', | 28 | 'FutureSprintVocabulary', |
604 | 29 | 'HostedBranchRestrictedOnOwnerVocabulary', | ||
605 | 28 | 'LanguageVocabulary', | 30 | 'LanguageVocabulary', |
606 | 31 | 'PackageReleaseVocabulary', | ||
607 | 29 | 'PPAVocabulary', | 32 | 'PPAVocabulary', |
608 | 30 | 'PackageReleaseVocabulary', | ||
609 | 31 | 'ProcessorFamilyVocabulary', | 33 | 'ProcessorFamilyVocabulary', |
610 | 32 | 'ProcessorVocabulary', | 34 | 'ProcessorVocabulary', |
611 | 35 | 'project_products_using_malone_vocabulary_factory', | ||
612 | 33 | 'SpecificationDepCandidatesVocabulary', | 36 | 'SpecificationDepCandidatesVocabulary', |
613 | 34 | 'SpecificationDependenciesVocabulary', | 37 | 'SpecificationDependenciesVocabulary', |
614 | 35 | 'SpecificationVocabulary', | 38 | 'SpecificationVocabulary', |
615 | @@ -39,7 +42,6 @@ | |||
616 | 39 | 'TranslationMessageVocabulary', | 42 | 'TranslationMessageVocabulary', |
617 | 40 | 'TranslationTemplateVocabulary', | 43 | 'TranslationTemplateVocabulary', |
618 | 41 | 'WebBugTrackerVocabulary', | 44 | 'WebBugTrackerVocabulary', |
619 | 42 | 'project_products_using_malone_vocabulary_factory', | ||
620 | 43 | ] | 45 | ] |
621 | 44 | 46 | ||
622 | 45 | import cgi | 47 | import cgi |
623 | 46 | 48 | ||
624 | === modified file 'lib/canonical/launchpad/webapp/configure.zcml' | |||
625 | --- lib/canonical/launchpad/webapp/configure.zcml 2010-01-13 13:23:20 +0000 | |||
626 | +++ lib/canonical/launchpad/webapp/configure.zcml 2010-01-18 21:51:20 +0000 | |||
627 | @@ -815,6 +815,7 @@ | |||
628 | 815 | 815 | ||
629 | 816 | <class class="canonical.launchpad.webapp.vocabulary.CountableIterator"> | 816 | <class class="canonical.launchpad.webapp.vocabulary.CountableIterator"> |
630 | 817 | <allow interface="canonical.launchpad.webapp.vocabulary.ICountableIterator" /> | 817 | <allow interface="canonical.launchpad.webapp.vocabulary.ICountableIterator" /> |
631 | 818 | <allow attributes="__getslice__"/> | ||
632 | 818 | </class> | 819 | </class> |
633 | 819 | 820 | ||
634 | 820 | <class class="canonical.launchpad.webapp.vocabulary.BatchedCountableIterator"> | 821 | <class class="canonical.launchpad.webapp.vocabulary.BatchedCountableIterator"> |
635 | 821 | 822 | ||
636 | === modified file 'lib/canonical/launchpad/webapp/metazcml.py' | |||
637 | --- lib/canonical/launchpad/webapp/metazcml.py 2009-10-21 13:11:48 +0000 | |||
638 | +++ lib/canonical/launchpad/webapp/metazcml.py 2010-01-18 21:51:20 +0000 | |||
639 | @@ -75,6 +75,8 @@ | |||
640 | 75 | 75 | ||
641 | 76 | component = GlobalObject(title=u'component', required=False) | 76 | component = GlobalObject(title=u'component', required=False) |
642 | 77 | 77 | ||
643 | 78 | name = TextLine(title=u"Name", required=False) | ||
644 | 79 | |||
645 | 78 | 80 | ||
646 | 79 | class PermissionCollectingContext: | 81 | class PermissionCollectingContext: |
647 | 80 | 82 | ||
648 | @@ -97,7 +99,8 @@ | |||
649 | 97 | 99 | ||
650 | 98 | class SecuredUtilityDirective: | 100 | class SecuredUtilityDirective: |
651 | 99 | 101 | ||
653 | 100 | def __init__(self, _context, provides, class_=None, component=None): | 102 | def __init__(self, _context, provides, class_=None, component=None, |
654 | 103 | name=''): | ||
655 | 101 | if class_ is not None: | 104 | if class_ is not None: |
656 | 102 | assert component is None, "Both class and component specified" | 105 | assert component is None, "Both class and component specified" |
657 | 103 | self.component = class_() | 106 | self.component = class_() |
658 | @@ -107,6 +110,7 @@ | |||
659 | 107 | self.component = component | 110 | self.component = component |
660 | 108 | self._context = _context | 111 | self._context = _context |
661 | 109 | self.provides = provides | 112 | self.provides = provides |
662 | 113 | self.name = name | ||
663 | 110 | self.permission_collector = PermissionCollectingContext() | 114 | self.permission_collector = PermissionCollectingContext() |
664 | 111 | self.contentdirective = ClassDirective( | 115 | self.contentdirective = ClassDirective( |
665 | 112 | self.permission_collector, class_) | 116 | self.permission_collector, class_) |
666 | @@ -127,7 +131,8 @@ | |||
667 | 127 | self.permission_collector.set_permissions | 131 | self.permission_collector.set_permissions |
668 | 128 | ) | 132 | ) |
669 | 129 | component = ProxyFactory(self.component, checker=checker) | 133 | component = ProxyFactory(self.component, checker=checker) |
671 | 130 | utility(self._context, self.provides, component=component) | 134 | utility(self._context, self.provides, component=component, |
672 | 135 | name=self.name) | ||
673 | 131 | return () | 136 | return () |
674 | 132 | 137 | ||
675 | 133 | 138 | ||
676 | 134 | 139 | ||
677 | === modified file 'lib/canonical/launchpad/zcml/binaryandsourcepackagename.zcml' | |||
678 | --- lib/canonical/launchpad/zcml/binaryandsourcepackagename.zcml 2009-07-13 18:15:02 +0000 | |||
679 | +++ lib/canonical/launchpad/zcml/binaryandsourcepackagename.zcml 2010-01-18 21:51:20 +0000 | |||
680 | @@ -15,11 +15,22 @@ | |||
681 | 15 | <allow interface="canonical.launchpad.interfaces.IBinaryAndSourcePackageName" /> | 15 | <allow interface="canonical.launchpad.interfaces.IBinaryAndSourcePackageName" /> |
682 | 16 | </class> | 16 | </class> |
683 | 17 | 17 | ||
685 | 18 | <utility | 18 | <class class="canonical.launchpad.database.binaryandsourcepackagename.BinaryAndSourcePackageNameIterator"> |
686 | 19 | <allow interface="canonical.launchpad.webapp.vocabulary.ICountableIterator" /> | ||
687 | 20 | </class> | ||
688 | 21 | |||
689 | 22 | <securedutility | ||
690 | 19 | name="BinaryAndSourcePackageName" | 23 | name="BinaryAndSourcePackageName" |
691 | 20 | component="canonical.launchpad.database.binaryandsourcepackagename.BinaryAndSourcePackageNameVocabulary" | 24 | component="canonical.launchpad.database.binaryandsourcepackagename.BinaryAndSourcePackageNameVocabulary" |
692 | 21 | provides="zope.schema.interfaces.IVocabularyFactory" | 25 | provides="zope.schema.interfaces.IVocabularyFactory" |
694 | 22 | /> | 26 | > |
695 | 27 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | ||
696 | 28 | </securedutility> | ||
697 | 29 | |||
698 | 30 | <class class="canonical.launchpad.database.binaryandsourcepackagename.BinaryAndSourcePackageNameVocabulary"> | ||
699 | 31 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
700 | 32 | </class> | ||
701 | 33 | |||
702 | 23 | 34 | ||
703 | 24 | </facet> | 35 | </facet> |
704 | 25 | </configure> | 36 | </configure> |
705 | 26 | 37 | ||
706 | === modified file 'lib/lp/answers/configure.zcml' | |||
707 | --- lib/lp/answers/configure.zcml 2009-09-22 18:45:02 +0000 | |||
708 | +++ lib/lp/answers/configure.zcml 2010-01-18 21:51:20 +0000 | |||
709 | @@ -221,11 +221,18 @@ | |||
710 | 221 | <allow interface=".interfaces.faq.IFAQSet" /> | 221 | <allow interface=".interfaces.faq.IFAQSet" /> |
711 | 222 | </securedutility> | 222 | </securedutility> |
712 | 223 | 223 | ||
714 | 224 | <utility | 224 | <securedutility |
715 | 225 | name="FAQ" | 225 | name="FAQ" |
716 | 226 | component=".vocabulary.FAQVocabulary" | 226 | component=".vocabulary.FAQVocabulary" |
717 | 227 | provides="zope.schema.interfaces.IVocabularyFactory" | 227 | provides="zope.schema.interfaces.IVocabularyFactory" |
719 | 228 | /> | 228 | > |
720 | 229 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | ||
721 | 230 | </securedutility> | ||
722 | 231 | |||
723 | 232 | <class class=".vocabulary.FAQVocabulary"> | ||
724 | 233 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
725 | 234 | </class> | ||
726 | 235 | |||
727 | 229 | 236 | ||
728 | 230 | <lp:help-folder | 237 | <lp:help-folder |
729 | 231 | folder="help" type="canonical.launchpad.layers.AnswersLayer" /> | 238 | folder="help" type="canonical.launchpad.layers.AnswersLayer" /> |
730 | 232 | 239 | ||
731 | === modified file 'lib/lp/answers/doc/faq-vocabulary.txt' | |||
732 | --- lib/lp/answers/doc/faq-vocabulary.txt 2009-04-17 10:32:16 +0000 | |||
733 | +++ lib/lp/answers/doc/faq-vocabulary.txt 2010-01-18 21:51:20 +0000 | |||
734 | @@ -73,9 +73,10 @@ | |||
735 | 73 | The searchForTerms() method returns a CountableIterator of terms that | 73 | The searchForTerms() method returns a CountableIterator of terms that |
736 | 74 | are similar to the query: | 74 | are similar to the query: |
737 | 75 | 75 | ||
738 | 76 | >>> from zope.security import proxy | ||
739 | 76 | >>> from canonical.launchpad.webapp.vocabulary import CountableIterator | 77 | >>> from canonical.launchpad.webapp.vocabulary import CountableIterator |
740 | 77 | >>> terms = vocabulary.searchForTerms('Problem showing SVG') | 78 | >>> terms = vocabulary.searchForTerms('Problem showing SVG') |
742 | 78 | >>> isinstance(terms, CountableIterator) | 79 | >>> proxy.isinstance(terms, CountableIterator) |
743 | 79 | True | 80 | True |
744 | 80 | >>> terms.count() | 81 | >>> terms.count() |
745 | 81 | 2 | 82 | 2 |
746 | 82 | 83 | ||
747 | === modified file 'lib/lp/registry/doc/vocabularies.txt' | |||
748 | --- lib/lp/registry/doc/vocabularies.txt 2009-12-24 01:41:54 +0000 | |||
749 | +++ lib/lp/registry/doc/vocabularies.txt 2010-01-18 21:51:20 +0000 | |||
750 | @@ -11,8 +11,12 @@ | |||
751 | 11 | >>> launchbag.clear() | 11 | >>> launchbag.clear() |
752 | 12 | 12 | ||
753 | 13 | >>> from zope.schema.vocabulary import getVocabularyRegistry | 13 | >>> from zope.schema.vocabulary import getVocabularyRegistry |
754 | 14 | >>> from zope.security.proxy import removeSecurityProxy | ||
755 | 14 | >>> vocabulary_registry = getVocabularyRegistry() | 15 | >>> vocabulary_registry = getVocabularyRegistry() |
757 | 15 | >>> product_vocabulary = vocabulary_registry.get(None, "Product") | 16 | >>> def get_naked_vocab(context, name): |
758 | 17 | ... return removeSecurityProxy( | ||
759 | 18 | ... vocabulary_registry.get(context, name)) | ||
760 | 19 | >>> product_vocabulary = get_naked_vocab(None, "Product") | ||
761 | 16 | 20 | ||
762 | 17 | 21 | ||
763 | 18 | == ActiveMailingList == | 22 | == ActiveMailingList == |
764 | @@ -20,7 +24,7 @@ | |||
765 | 20 | The active mailing lists vocabulary matches and returns only those mailing | 24 | The active mailing lists vocabulary matches and returns only those mailing |
766 | 21 | lists which are active. | 25 | lists which are active. |
767 | 22 | 26 | ||
769 | 23 | >>> list_vocabulary = vocabulary_registry.get(None, 'ActiveMailingList') | 27 | >>> list_vocabulary = get_naked_vocab(None, 'ActiveMailingList') |
770 | 24 | >>> from canonical.launchpad.webapp.testing import verifyObject | 28 | >>> from canonical.launchpad.webapp.testing import verifyObject |
771 | 25 | >>> from canonical.launchpad.webapp.vocabulary import IHugeVocabulary | 29 | >>> from canonical.launchpad.webapp.vocabulary import IHugeVocabulary |
772 | 26 | >>> verifyObject(IHugeVocabulary, list_vocabulary) | 30 | >>> verifyObject(IHugeVocabulary, list_vocabulary) |
773 | @@ -181,7 +185,7 @@ | |||
774 | 181 | Reflects the available distribution series. Results are ordered by | 185 | Reflects the available distribution series. Results are ordered by |
775 | 182 | `name` | 186 | `name` |
776 | 183 | 187 | ||
778 | 184 | >>> distroseries_vocabulary = vocabulary_registry.get( | 188 | >>> distroseries_vocabulary = get_naked_vocab( |
779 | 185 | ... None,"DistroSeries") | 189 | ... None,"DistroSeries") |
780 | 186 | >>> for term in distroseries_vocabulary: | 190 | >>> for term in distroseries_vocabulary: |
781 | 187 | ... print "%30s %s" % (term.token, term.title) | 191 | ... print "%30s %s" % (term.token, term.title) |
782 | @@ -225,7 +229,7 @@ | |||
783 | 225 | All the teams the person is an active member of. | 229 | All the teams the person is an active member of. |
784 | 226 | 230 | ||
785 | 227 | >>> foo_bar = person_set.getByEmail('foo.bar@canonical.com') | 231 | >>> foo_bar = person_set.getByEmail('foo.bar@canonical.com') |
787 | 228 | >>> person_active_membership = vocabulary_registry.get( | 232 | >>> person_active_membership = get_naked_vocab( |
788 | 229 | ... foo_bar, 'PersonActiveMembership') | 233 | ... foo_bar, 'PersonActiveMembership') |
789 | 230 | >>> len(person_active_membership) | 234 | >>> len(person_active_membership) |
790 | 231 | 10 | 235 | 10 |
791 | @@ -320,7 +324,7 @@ | |||
792 | 320 | [u'hwdb-team', u'landscape-developers', u'launchpad-users', u'name18', | 324 | [u'hwdb-team', u'landscape-developers', u'launchpad-users', u'name18', |
793 | 321 | u'name20'] | 325 | u'name20'] |
794 | 322 | 326 | ||
796 | 323 | >>> sample_person_teams_vocabulary = vocabulary_registry.get( | 327 | >>> sample_person_teams_vocabulary = get_naked_vocab( |
797 | 324 | ... sample_person, 'PersonTeamParticipations') | 328 | ... sample_person, 'PersonTeamParticipations') |
798 | 325 | 329 | ||
799 | 326 | >>> for term in sample_person_teams_vocabulary: | 330 | >>> for term in sample_person_teams_vocabulary: |
800 | @@ -343,13 +347,13 @@ | |||
801 | 343 | to the current context. If no context is given, or if the context does | 347 | to the current context. If no context is given, or if the context does |
802 | 344 | not have any milestones, a MilestoneVocabulary is empty... | 348 | not have any milestones, a MilestoneVocabulary is empty... |
803 | 345 | 349 | ||
805 | 346 | >>> milestones = vocabulary_registry.get(None, 'Milestone') | 350 | >>> milestones = get_naked_vocab(None, 'Milestone') |
806 | 347 | >>> len(milestones) | 351 | >>> len(milestones) |
807 | 348 | 0 | 352 | 0 |
808 | 349 | 353 | ||
809 | 350 | >>> from canonical.launchpad.interfaces import IMaloneApplication | 354 | >>> from canonical.launchpad.interfaces import IMaloneApplication |
810 | 351 | >>> malone = getUtility(IMaloneApplication) | 355 | >>> malone = getUtility(IMaloneApplication) |
812 | 352 | >>> milestones = vocabulary_registry.get(malone, 'Milestone') | 356 | >>> milestones = get_naked_vocab(malone, 'Milestone') |
813 | 353 | >>> len(milestones) | 357 | >>> len(milestones) |
814 | 354 | 0 | 358 | 0 |
815 | 355 | 359 | ||
816 | @@ -358,7 +362,7 @@ | |||
817 | 358 | milestones from RelevantMilestonesMixin.getMilestoneWidgetValues() | 362 | milestones from RelevantMilestonesMixin.getMilestoneWidgetValues() |
818 | 359 | but we need the big default vocabulary for form input validation. | 363 | but we need the big default vocabulary for form input validation. |
819 | 360 | 364 | ||
821 | 361 | >>> all_milestones = vocabulary_registry.get(sample_person, 'Milestone') | 365 | >>> all_milestones = get_naked_vocab(sample_person, 'Milestone') |
822 | 362 | >>> len(all_milestones) | 366 | >>> len(all_milestones) |
823 | 363 | 3 | 367 | 3 |
824 | 364 | >>> for term in all_milestones: | 368 | >>> for term in all_milestones: |
825 | @@ -371,7 +375,7 @@ | |||
826 | 371 | vocabulary. | 375 | vocabulary. |
827 | 372 | 376 | ||
828 | 373 | >>> firefox = product_set.getByName('firefox') | 377 | >>> firefox = product_set.getByName('firefox') |
830 | 374 | >>> firefox_milestones = vocabulary_registry.get(firefox, 'Milestone') | 378 | >>> firefox_milestones = get_naked_vocab(firefox, 'Milestone') |
831 | 375 | >>> for term in firefox_milestones: | 379 | >>> for term in firefox_milestones: |
832 | 376 | ... print "%s: %s" % (term.value.target.name, term.value.name) | 380 | ... print "%s: %s" % (term.value.target.name, term.value.name) |
833 | 377 | firefox: 1.0 | 381 | firefox: 1.0 |
834 | @@ -382,7 +386,7 @@ | |||
835 | 382 | >>> firefox_trunk = firefox.getSeries('trunk') | 386 | >>> firefox_trunk = firefox.getSeries('trunk') |
836 | 383 | >>> firefox_milestone = factory.makeMilestone( | 387 | >>> firefox_milestone = factory.makeMilestone( |
837 | 384 | ... product=firefox, name='firefox-milestone-no-series') | 388 | ... product=firefox, name='firefox-milestone-no-series') |
839 | 385 | >>> firefox_trunk_milestones = vocabulary_registry.get(firefox_trunk, | 389 | >>> firefox_trunk_milestones = get_naked_vocab(firefox_trunk, |
840 | 386 | ... 'Milestone') | 390 | ... 'Milestone') |
841 | 387 | >>> for term in firefox_trunk_milestones: | 391 | >>> for term in firefox_trunk_milestones: |
842 | 388 | ... print "%s: %s" % (term.value.target.name, term.value.name) | 392 | ... print "%s: %s" % (term.value.target.name, term.value.name) |
843 | @@ -397,7 +401,7 @@ | |||
844 | 397 | >>> firefox_task = bug_one.bugtasks[0] | 401 | >>> firefox_task = bug_one.bugtasks[0] |
845 | 398 | >>> firefox_task.bugtargetdisplayname | 402 | >>> firefox_task.bugtargetdisplayname |
846 | 399 | u'Mozilla Firefox' | 403 | u'Mozilla Firefox' |
848 | 400 | >>> firefox_task_milestones = vocabulary_registry.get( | 404 | >>> firefox_task_milestones = get_naked_vocab( |
849 | 401 | ... firefox_task, 'Milestone') | 405 | ... firefox_task, 'Milestone') |
850 | 402 | >>> for term in firefox_task_milestones: | 406 | >>> for term in firefox_task_milestones: |
851 | 403 | ... print "%s: %s" % (term.value.target.name, term.value.name) | 407 | ... print "%s: %s" % (term.value.target.name, term.value.name) |
852 | @@ -408,7 +412,7 @@ | |||
853 | 408 | >>> debian_woody_task = bug_two.bugtasks[-1] | 412 | >>> debian_woody_task = bug_two.bugtasks[-1] |
854 | 409 | >>> debian_woody_task.bugtargetdisplayname | 413 | >>> debian_woody_task.bugtargetdisplayname |
855 | 410 | u'mozilla-firefox (Debian Woody)' | 414 | u'mozilla-firefox (Debian Woody)' |
857 | 411 | >>> debian_woody_milestones = vocabulary_registry.get( | 415 | >>> debian_woody_milestones = get_naked_vocab( |
858 | 412 | ... debian_woody_task, 'Milestone') | 416 | ... debian_woody_task, 'Milestone') |
859 | 413 | >>> debian_woody = debian_woody_task.distroseries | 417 | >>> debian_woody = debian_woody_task.distroseries |
860 | 414 | >>> len(debian_woody_milestones) | 418 | >>> len(debian_woody_milestones) |
861 | @@ -420,7 +424,7 @@ | |||
862 | 420 | >>> milestone = debian_woody.milestones[0] | 424 | >>> milestone = debian_woody.milestones[0] |
863 | 421 | >>> milestone.active = False | 425 | >>> milestone.active = False |
864 | 422 | >>> flush_database_updates() | 426 | >>> flush_database_updates() |
866 | 423 | >>> len(vocabulary_registry.get(debian_woody_task, 'Milestone')) | 427 | >>> len(get_naked_vocab(debian_woody_task, 'Milestone')) |
867 | 424 | 1 | 428 | 1 |
868 | 425 | 429 | ||
869 | 426 | If the milestone was used in a bugtask before it was marked inactive, though, | 430 | If the milestone was used in a bugtask before it was marked inactive, though, |
870 | @@ -428,7 +432,7 @@ | |||
871 | 428 | 432 | ||
872 | 429 | >>> debian_woody_task.milestone = milestone | 433 | >>> debian_woody_task.milestone = milestone |
873 | 430 | >>> flush_database_updates() | 434 | >>> flush_database_updates() |
875 | 431 | >>> len(vocabulary_registry.get(debian_woody_task, 'Milestone')) | 435 | >>> len(get_naked_vocab(debian_woody_task, 'Milestone')) |
876 | 432 | 2 | 436 | 2 |
877 | 433 | 437 | ||
878 | 434 | This is true for inactive milestones used in bugtasks for products and | 438 | This is true for inactive milestones used in bugtasks for products and |
879 | @@ -436,7 +440,7 @@ | |||
880 | 436 | 440 | ||
881 | 437 | >>> product_bugtask = factory.makeBugTask(target=firefox) | 441 | >>> product_bugtask = factory.makeBugTask(target=firefox) |
882 | 438 | >>> product_bugtask.milestone = firefox_milestone | 442 | >>> product_bugtask.milestone = firefox_milestone |
884 | 439 | >>> product_target_milestones = vocabulary_registry.get( | 443 | >>> product_target_milestones = get_naked_vocab( |
885 | 440 | ... product_bugtask, 'Milestone') | 444 | ... product_bugtask, 'Milestone') |
886 | 441 | >>> for term in product_target_milestones: | 445 | >>> for term in product_target_milestones: |
887 | 442 | ... print "%s: %s" % (term.value.target.name, term.value.name) | 446 | ... print "%s: %s" % (term.value.target.name, term.value.name) |
888 | @@ -444,7 +448,7 @@ | |||
889 | 444 | firefox: firefox-milestone-no-series | 448 | firefox: firefox-milestone-no-series |
890 | 445 | 449 | ||
891 | 446 | >>> firefox_milestone.active = False | 450 | >>> firefox_milestone.active = False |
893 | 447 | >>> product_target_milestones = vocabulary_registry.get( | 451 | >>> product_target_milestones = get_naked_vocab( |
894 | 448 | ... product_bugtask, 'Milestone') | 452 | ... product_bugtask, 'Milestone') |
895 | 449 | >>> for term in product_target_milestones: | 453 | >>> for term in product_target_milestones: |
896 | 450 | ... print "%s: %s" % (term.value.target.name, term.value.name) | 454 | ... print "%s: %s" % (term.value.target.name, term.value.name) |
897 | @@ -453,7 +457,7 @@ | |||
898 | 453 | 457 | ||
899 | 454 | >>> productseries_bugtask = factory.makeBugTask(target=firefox_trunk) | 458 | >>> productseries_bugtask = factory.makeBugTask(target=firefox_trunk) |
900 | 455 | >>> productseries_bugtask.milestone = firefox_milestone | 459 | >>> productseries_bugtask.milestone = firefox_milestone |
902 | 456 | >>> productseries_target_milestones = vocabulary_registry.get( | 460 | >>> productseries_target_milestones = get_naked_vocab( |
903 | 457 | ... productseries_bugtask, 'Milestone') | 461 | ... productseries_bugtask, 'Milestone') |
904 | 458 | >>> for term in productseries_target_milestones: | 462 | >>> for term in productseries_target_milestones: |
905 | 459 | ... print "%s: %s" % (term.value.target.name, term.value.name) | 463 | ... print "%s: %s" % (term.value.target.name, term.value.name) |
906 | @@ -464,7 +468,7 @@ | |||
907 | 464 | target are in the vocabulary. | 468 | target are in the vocabulary. |
908 | 465 | 469 | ||
909 | 466 | >>> canvas_spec = firefox.getSpecification('canvas') | 470 | >>> canvas_spec = firefox.getSpecification('canvas') |
911 | 467 | >>> spec_target_milestones = vocabulary_registry.get( | 471 | >>> spec_target_milestones = get_naked_vocab( |
912 | 468 | ... canvas_spec, 'Milestone') | 472 | ... canvas_spec, 'Milestone') |
913 | 469 | >>> for term in spec_target_milestones: | 473 | >>> for term in spec_target_milestones: |
914 | 470 | ... print "%s: %s" % (term.value.target.name, term.value.name) | 474 | ... print "%s: %s" % (term.value.target.name, term.value.name) |
915 | @@ -481,10 +485,10 @@ | |||
916 | 481 | u'1.0' | 485 | u'1.0' |
917 | 482 | >>> one_dot_o.active = False | 486 | >>> one_dot_o.active = False |
918 | 483 | 487 | ||
920 | 484 | >>> firefox_milestones = vocabulary_registry.get(firefox, 'Milestone') | 488 | >>> firefox_milestones = get_naked_vocab(firefox, 'Milestone') |
921 | 485 | >>> len(firefox_milestones) | 489 | >>> len(firefox_milestones) |
922 | 486 | 0 | 490 | 0 |
924 | 487 | >>> firefox_task_milestones = vocabulary_registry.get( | 491 | >>> firefox_task_milestones = get_naked_vocab( |
925 | 488 | ... firefox_task, 'Milestone') | 492 | ... firefox_task, 'Milestone') |
926 | 489 | >>> len(firefox_task_milestones) | 493 | >>> len(firefox_task_milestones) |
927 | 490 | 0 | 494 | 0 |
928 | @@ -495,7 +499,7 @@ | |||
929 | 495 | All the products in a project. | 499 | All the products in a project. |
930 | 496 | 500 | ||
931 | 497 | >>> mozilla_project = getUtility(IProjectSet).getByName('mozilla') | 501 | >>> mozilla_project = getUtility(IProjectSet).getByName('mozilla') |
933 | 498 | >>> mozilla_products_vocabulary = vocabulary_registry.get( | 502 | >>> mozilla_products_vocabulary = get_naked_vocab( |
934 | 499 | ... mozilla_project,'ProjectProducts') | 503 | ... mozilla_project,'ProjectProducts') |
935 | 500 | 504 | ||
936 | 501 | >>> for term in mozilla_products_vocabulary: | 505 | >>> for term in mozilla_products_vocabulary: |
937 | @@ -508,7 +512,7 @@ | |||
938 | 508 | 512 | ||
939 | 509 | The list of selectable projects. The results are ordered by displayname. | 513 | The list of selectable projects. The results are ordered by displayname. |
940 | 510 | 514 | ||
942 | 511 | >>> project_vocabulary = vocabulary_registry.get(None, "Project") | 515 | >>> project_vocabulary = get_naked_vocab(None, "Project") |
943 | 512 | >>> project_vocabulary.displayname | 516 | >>> project_vocabulary.displayname |
944 | 513 | 'Select a project group' | 517 | 'Select a project group' |
945 | 514 | 518 | ||
946 | @@ -542,7 +546,7 @@ | |||
947 | 542 | 546 | ||
948 | 543 | The list of selectable products. Results are ordered by displayname. | 547 | The list of selectable products. Results are ordered by displayname. |
949 | 544 | 548 | ||
951 | 545 | >>> product_vocabulary = vocabulary_registry.get(None, "Product") | 549 | >>> product_vocabulary = get_naked_vocab(None, "Product") |
952 | 546 | >>> product_vocabulary.displayname | 550 | >>> product_vocabulary.displayname |
953 | 547 | 'Select a project' | 551 | 'Select a project' |
954 | 548 | 552 | ||
955 | @@ -583,8 +587,7 @@ | |||
956 | 583 | 587 | ||
957 | 584 | The list of selectable products releases. | 588 | The list of selectable products releases. |
958 | 585 | 589 | ||
961 | 586 | >>> productrelease_vocabulary = vocabulary_registry.get(None, | 590 | >>> productrelease_vocabulary = get_naked_vocab(None, "ProductRelease") |
960 | 587 | ... "ProductRelease") | ||
962 | 588 | >>> productrelease_vocabulary.displayname | 591 | >>> productrelease_vocabulary.displayname |
963 | 589 | 'Select a Product Release' | 592 | 'Select a Product Release' |
964 | 590 | 593 | ||
965 | @@ -603,7 +606,7 @@ | |||
966 | 603 | All non-merged people with at least one email address. This vocabulary is | 606 | All non-merged people with at least one email address. This vocabulary is |
967 | 604 | meant to be used only in the people merge form. | 607 | meant to be used only in the people merge form. |
968 | 605 | 608 | ||
970 | 606 | >>> vocab = vocabulary_registry.get(None, "PersonAccountToMerge") | 609 | >>> vocab = get_naked_vocab(None, "PersonAccountToMerge") |
971 | 607 | >>> vocab.displayname | 610 | >>> vocab.displayname |
972 | 608 | 'Select a Person to Merge' | 611 | 'Select a Person to Merge' |
973 | 609 | 612 | ||
974 | @@ -668,7 +671,6 @@ | |||
975 | 668 | True | 671 | True |
976 | 669 | 672 | ||
977 | 670 | # Here we cheat because IPerson.merged is a readonly attribute. | 673 | # Here we cheat because IPerson.merged is a readonly attribute. |
978 | 671 | >>> from zope.security.proxy import removeSecurityProxy | ||
979 | 672 | >>> naked_cprov = removeSecurityProxy(cprov) | 674 | >>> naked_cprov = removeSecurityProxy(cprov) |
980 | 673 | >>> naked_cprov.merged = 1 | 675 | >>> naked_cprov.merged = 1 |
981 | 674 | >>> naked_cprov.syncUpdate() | 676 | >>> naked_cprov.syncUpdate() |
982 | @@ -693,7 +695,7 @@ | |||
983 | 693 | 695 | ||
984 | 694 | The set of non-merged people. | 696 | The set of non-merged people. |
985 | 695 | 697 | ||
987 | 696 | >>> vocab = vocabulary_registry.get(None, "AdminMergeablePerson") | 698 | >>> vocab = get_naked_vocab(None, "AdminMergeablePerson") |
988 | 697 | >>> vocab.displayname | 699 | >>> vocab.displayname |
989 | 698 | 'Select a Person to Merge' | 700 | 'Select a Person to Merge' |
990 | 699 | 701 | ||
991 | @@ -712,7 +714,7 @@ | |||
992 | 712 | 714 | ||
993 | 713 | All non-merged people and teams. | 715 | All non-merged people and teams. |
994 | 714 | 716 | ||
996 | 715 | >>> vocab = vocabulary_registry.get(None, "NonMergedPeopleAndTeams") | 717 | >>> vocab = get_naked_vocab(None, "NonMergedPeopleAndTeams") |
997 | 716 | >>> vocab.displayname | 718 | >>> vocab.displayname |
998 | 717 | 'Select a Person or Team' | 719 | 'Select a Person or Team' |
999 | 718 | 720 | ||
1000 | @@ -746,7 +748,7 @@ | |||
1001 | 746 | None). It also includes all public teams and private teams the | 748 | None). It also includes all public teams and private teams the |
1002 | 747 | user has permission to view. | 749 | user has permission to view. |
1003 | 748 | 750 | ||
1005 | 749 | >>> vocab = vocabulary_registry.get(None, "ValidPersonOrTeam") | 751 | >>> vocab = get_naked_vocab(None, "ValidPersonOrTeam") |
1006 | 750 | >>> vocab.displayname | 752 | >>> vocab.displayname |
1007 | 751 | 'Select a Person or Team' | 753 | 'Select a Person or Team' |
1008 | 752 | 754 | ||
1009 | @@ -794,7 +796,7 @@ | |||
1010 | 794 | A PRIVATE team is displayed when the logged in user is a member of the team. | 796 | A PRIVATE team is displayed when the logged in user is a member of the team. |
1011 | 795 | 797 | ||
1012 | 796 | >>> commercial = person_set.getByEmail('commercial-member@canonical.com') | 798 | >>> commercial = person_set.getByEmail('commercial-member@canonical.com') |
1014 | 797 | >>> vocab = vocabulary_registry.get(commercial, "ValidPersonOrTeam") | 799 | >>> vocab = get_naked_vocab(commercial, "ValidPersonOrTeam") |
1015 | 798 | >>> login('commercial-member@canonical.com') | 800 | >>> login('commercial-member@canonical.com') |
1016 | 799 | >>> priv_team = factory.makeTeam( | 801 | >>> priv_team = factory.makeTeam( |
1017 | 800 | ... name='private-team', | 802 | ... name='private-team', |
1018 | @@ -861,7 +863,7 @@ | |||
1019 | 861 | one of its email addresses. | 863 | one of its email addresses. |
1020 | 862 | 864 | ||
1021 | 863 | >>> login('foo.bar@canonical.com') | 865 | >>> login('foo.bar@canonical.com') |
1023 | 864 | >>> vocab = vocabulary_registry.get(None, "ValidPersonOrTeam") | 866 | >>> vocab = get_naked_vocab(None, "ValidPersonOrTeam") |
1024 | 865 | >>> sorted(person.name for person in vocab.search('support')) | 867 | >>> sorted(person.name for person in vocab.search('support')) |
1025 | 866 | [u'ubuntu-team'] | 868 | [u'ubuntu-team'] |
1026 | 867 | 869 | ||
1027 | @@ -932,7 +934,7 @@ | |||
1028 | 932 | All valid persons and teams are also valid owners. | 934 | All valid persons and teams are also valid owners. |
1029 | 933 | 935 | ||
1030 | 934 | >>> login(ANONYMOUS) | 936 | >>> login(ANONYMOUS) |
1032 | 935 | >>> vocab = vocabulary_registry.get(None, "ValidOwner") | 937 | >>> vocab = get_naked_vocab(None, "ValidOwner") |
1033 | 936 | >>> vocab.displayname | 938 | >>> vocab.displayname |
1034 | 937 | 'Select a Person or Team' | 939 | 'Select a Person or Team' |
1035 | 938 | 940 | ||
1036 | @@ -955,7 +957,7 @@ | |||
1037 | 955 | except that its terms are limited only to teams. No non-team Persons will be | 957 | except that its terms are limited only to teams. No non-team Persons will be |
1038 | 956 | returned. | 958 | returned. |
1039 | 957 | 959 | ||
1041 | 958 | >>> vocab = vocabulary_registry.get(None, 'ValidTeam') | 960 | >>> vocab = get_naked_vocab(None, 'ValidTeam') |
1042 | 959 | >>> vocab.displayname | 961 | >>> vocab.displayname |
1043 | 960 | 'Select a Team' | 962 | 'Select a Team' |
1044 | 961 | >>> sorted((team.displayname, team.teamowner.displayname) | 963 | >>> sorted((team.displayname, team.teamowner.displayname) |
1045 | @@ -1062,21 +1064,21 @@ | |||
1046 | 1062 | 1064 | ||
1047 | 1063 | ValidTeamMember needs a context: | 1065 | ValidTeamMember needs a context: |
1048 | 1064 | 1066 | ||
1050 | 1065 | >>> vocab = vocabulary_registry.get(None, "ValidTeamMember") | 1067 | >>> vocab = get_naked_vocab(None, "ValidTeamMember") |
1051 | 1066 | Traceback (most recent call last): | 1068 | Traceback (most recent call last): |
1052 | 1067 | ... | 1069 | ... |
1053 | 1068 | AssertionError: ... | 1070 | AssertionError: ... |
1054 | 1069 | 1071 | ||
1055 | 1070 | ValidTeamMember's context must implement ITeam: | 1072 | ValidTeamMember's context must implement ITeam: |
1056 | 1071 | 1073 | ||
1058 | 1072 | >>> vocab = vocabulary_registry.get(person, "ValidTeamMember") | 1074 | >>> vocab = get_naked_vocab(person, "ValidTeamMember") |
1059 | 1073 | Traceback (most recent call last): | 1075 | Traceback (most recent call last): |
1060 | 1074 | ... | 1076 | ... |
1061 | 1075 | AssertionError: ... | 1077 | AssertionError: ... |
1062 | 1076 | 1078 | ||
1063 | 1077 | 'name16' is a valid member for 'ubuntu-team': | 1079 | 'name16' is a valid member for 'ubuntu-team': |
1064 | 1078 | 1080 | ||
1066 | 1079 | >>> vocab = vocabulary_registry.get(team, "ValidTeamMember") | 1081 | >>> vocab = get_naked_vocab(team, "ValidTeamMember") |
1067 | 1080 | >>> vocab.displayname | 1082 | >>> vocab.displayname |
1068 | 1081 | 'Select a Person or Team' | 1083 | 'Select a Person or Team' |
1069 | 1082 | 1084 | ||
1070 | @@ -1108,25 +1110,25 @@ | |||
1071 | 1108 | 1110 | ||
1072 | 1109 | ValidTeamOwner needs a context. | 1111 | ValidTeamOwner needs a context. |
1073 | 1110 | 1112 | ||
1075 | 1111 | >>> vocab = vocabulary_registry.get(None, "ValidTeamOwner") | 1113 | >>> vocab = get_naked_vocab(None, "ValidTeamOwner") |
1076 | 1112 | Traceback (most recent call last): | 1114 | Traceback (most recent call last): |
1077 | 1113 | ... | 1115 | ... |
1078 | 1114 | AssertionError: ... | 1116 | AssertionError: ... |
1079 | 1115 | 1117 | ||
1080 | 1116 | ValidTeamOwner's context must provide IPerson or IPersonSet. | 1118 | ValidTeamOwner's context must provide IPerson or IPersonSet. |
1081 | 1117 | 1119 | ||
1087 | 1118 | >>> vocabulary_registry.get(team, "ValidTeamOwner") | 1120 | >>> get_naked_vocab(team, "ValidTeamOwner") |
1088 | 1119 | <...ValidTeamOwnerVocabulary... | 1121 | <...ValidTeamOwnerVocabulary... |
1089 | 1120 | >>> vocabulary_registry.get(person_set, "ValidTeamOwner") | 1122 | >>> get_naked_vocab(person_set, "ValidTeamOwner") |
1090 | 1121 | <...ValidTeamOwnerVocabulary... | 1123 | <...ValidTeamOwnerVocabulary... |
1091 | 1122 | >>> vocabulary_registry.get(firefox, "ValidTeamOwner") | 1124 | >>> get_naked_vocab(firefox, "ValidTeamOwner") |
1092 | 1123 | Traceback (most recent call last): | 1125 | Traceback (most recent call last): |
1093 | 1124 | ... | 1126 | ... |
1094 | 1125 | AssertionError: ... | 1127 | AssertionError: ... |
1095 | 1126 | 1128 | ||
1096 | 1127 | 'ubuntu-team' is not a valid owner for itself. | 1129 | 'ubuntu-team' is not a valid owner for itself. |
1097 | 1128 | 1130 | ||
1099 | 1129 | >>> vocab = vocabulary_registry.get(team, "ValidTeamOwner") | 1131 | >>> vocab = get_naked_vocab(team, "ValidTeamOwner") |
1100 | 1130 | >>> vocab.displayname | 1132 | >>> vocab.displayname |
1101 | 1131 | 'Select a Person or Team' | 1133 | 'Select a Person or Team' |
1102 | 1132 | 1134 | ||
1103 | @@ -1147,7 +1149,7 @@ | |||
1104 | 1147 | 1149 | ||
1105 | 1148 | All 'valid' persons who are not a team. | 1150 | All 'valid' persons who are not a team. |
1106 | 1149 | 1151 | ||
1108 | 1150 | >>> vocab = vocabulary_registry.get(None, "ValidPerson") | 1152 | >>> vocab = get_naked_vocab(None, "ValidPerson") |
1109 | 1151 | >>> vocab.displayname | 1153 | >>> vocab.displayname |
1110 | 1152 | 'Select a Person' | 1154 | 'Select a Person' |
1111 | 1153 | >>> people = vocab.search(None) | 1155 | >>> people = vocab.search(None) |
1112 | @@ -1172,8 +1174,7 @@ | |||
1113 | 1172 | >>> carlos = getUtility(IPersonSet).getByName('carlos') | 1174 | >>> carlos = getUtility(IPersonSet).getByName('carlos') |
1114 | 1173 | >>> carlos_team = factory.makeTeam( | 1175 | >>> carlos_team = factory.makeTeam( |
1115 | 1174 | ... owner=carlos, name='carlos-team') | 1176 | ... owner=carlos, name='carlos-team') |
1118 | 1175 | >>> person_or_team_vocab = vocabulary_registry.get( | 1177 | >>> person_or_team_vocab = get_naked_vocab(None, "ValidPersonOrTeam") |
1117 | 1176 | ... None, "ValidPersonOrTeam") | ||
1119 | 1177 | >>> carlos_people_or_team = person_or_team_vocab.search('carlos') | 1178 | >>> carlos_people_or_team = person_or_team_vocab.search('carlos') |
1120 | 1178 | >>> # The people or team search yields our one Carlos person and | 1179 | >>> # The people or team search yields our one Carlos person and |
1121 | 1179 | >>> # the new team. | 1180 | >>> # the new team. |
1122 | @@ -1196,7 +1197,7 @@ | |||
1123 | 1196 | All products and distributions. Note that the value type is | 1197 | All products and distributions. Note that the value type is |
1124 | 1197 | heterogeneous. | 1198 | heterogeneous. |
1125 | 1198 | 1199 | ||
1127 | 1199 | >>> vocab = vocabulary_registry.get(None, "DistributionOrProduct") | 1200 | >>> vocab = get_naked_vocab(None, "DistributionOrProduct") |
1128 | 1200 | >>> for term in vocab: | 1201 | >>> for term in vocab: |
1129 | 1201 | ... if 'Ubuntu' in term.title: | 1202 | ... if 'Ubuntu' in term.title: |
1130 | 1202 | ... print term.title, '- class', term.value.__class__.__name__ | 1203 | ... print term.title, '- class', term.value.__class__.__name__ |
1131 | @@ -1236,12 +1237,12 @@ | |||
1132 | 1236 | True | 1237 | True |
1133 | 1237 | >>> tomcat.active = False | 1238 | >>> tomcat.active = False |
1134 | 1238 | >>> flush_database_updates() | 1239 | >>> flush_database_updates() |
1136 | 1239 | >>> vocab = vocabulary_registry.get(None, "DistributionOrProduct") | 1240 | >>> vocab = get_naked_vocab(None, "DistributionOrProduct") |
1137 | 1240 | >>> tomcat in vocab | 1241 | >>> tomcat in vocab |
1138 | 1241 | False | 1242 | False |
1139 | 1242 | >>> tomcat.active = True | 1243 | >>> tomcat.active = True |
1140 | 1243 | >>> flush_database_updates() | 1244 | >>> flush_database_updates() |
1142 | 1244 | >>> vocab = vocabulary_registry.get(None, "DistributionOrProduct") | 1245 | >>> vocab = get_naked_vocab(None, "DistributionOrProduct") |
1143 | 1245 | >>> tomcat in vocab | 1246 | >>> tomcat in vocab |
1144 | 1246 | True | 1247 | True |
1145 | 1247 | 1248 | ||
1146 | @@ -1257,7 +1258,7 @@ | |||
1147 | 1257 | All products, projects and distributions. Note that the value type is | 1258 | All products, projects and distributions. Note that the value type is |
1148 | 1258 | heterogeneous. | 1259 | heterogeneous. |
1149 | 1259 | 1260 | ||
1151 | 1260 | >>> vocab = vocabulary_registry.get(None, "DistributionOrProductOrProject") | 1261 | >>> vocab = get_naked_vocab(None, "DistributionOrProductOrProject") |
1152 | 1261 | >>> for term in vocab: | 1262 | >>> for term in vocab: |
1153 | 1262 | ... if 'Ubuntu' in term.title: | 1263 | ... if 'Ubuntu' in term.title: |
1154 | 1263 | ... print term.title, '- class', term.value.__class__.__name__ | 1264 | ... print term.title, '- class', term.value.__class__.__name__ |
1155 | @@ -1297,7 +1298,7 @@ | |||
1156 | 1297 | >>> apache in vocab | 1298 | >>> apache in vocab |
1157 | 1298 | False | 1299 | False |
1158 | 1299 | 1300 | ||
1160 | 1300 | >>> vocab = vocabulary_registry.get(None, "DistributionOrProductOrProject") | 1301 | >>> vocab = get_naked_vocab(None, "DistributionOrProductOrProject") |
1161 | 1301 | >>> for term in vocab: | 1302 | >>> for term in vocab: |
1162 | 1302 | ... if 'Apache' in term.title: | 1303 | ... if 'Apache' in term.title: |
1163 | 1303 | ... print term.title, '- class', term.value.__class__.__name__ | 1304 | ... print term.title, '- class', term.value.__class__.__name__ |
1164 | @@ -1307,7 +1308,7 @@ | |||
1165 | 1307 | >>> product_set.getByName('tomcat').active = True | 1308 | >>> product_set.getByName('tomcat').active = True |
1166 | 1308 | >>> getUtility(IProjectSet).getByName('apache').active = True | 1309 | >>> getUtility(IProjectSet).getByName('apache').active = True |
1167 | 1309 | >>> flush_database_updates() | 1310 | >>> flush_database_updates() |
1169 | 1310 | >>> vocab = vocabulary_registry.get(None, "DistributionOrProductOrProject") | 1311 | >>> vocab = get_naked_vocab(None, "DistributionOrProductOrProject") |
1170 | 1311 | >>> for term in vocab: | 1312 | >>> for term in vocab: |
1171 | 1312 | ... if 'Apache' in term.title: | 1313 | ... if 'Apache' in term.title: |
1172 | 1313 | ... print term.title, '- class', term.value.__class__.__name__ | 1314 | ... print term.title, '- class', term.value.__class__.__name__ |
1173 | @@ -1325,7 +1326,7 @@ | |||
1174 | 1325 | DistributionOrProductOrProjectVocabulary (defined using the | 1326 | DistributionOrProductOrProjectVocabulary (defined using the |
1175 | 1326 | _clauseTables). | 1327 | _clauseTables). |
1176 | 1327 | 1328 | ||
1178 | 1328 | >>> featured_project_vocabulary = vocabulary_registry.get( | 1329 | >>> featured_project_vocabulary = get_naked_vocab( |
1179 | 1329 | ... None, 'FeaturedProject') | 1330 | ... None, 'FeaturedProject') |
1180 | 1330 | >>> len(featured_project_vocabulary) | 1331 | >>> len(featured_project_vocabulary) |
1181 | 1331 | 9 | 1332 | 9 |
1182 | @@ -1376,7 +1377,7 @@ | |||
1183 | 1376 | >>> check_permission('launchpad.Commercial', bac) | 1377 | >>> check_permission('launchpad.Commercial', bac) |
1184 | 1377 | False | 1378 | False |
1185 | 1378 | 1379 | ||
1187 | 1379 | >>> comm_proj_vocab = vocabulary_registry.get(bac, "CommercialProjects") | 1380 | >>> comm_proj_vocab = get_naked_vocab(bac, "CommercialProjects") |
1188 | 1380 | >>> print comm_proj_vocab.displayname | 1381 | >>> print comm_proj_vocab.displayname |
1189 | 1381 | Select a commercial project | 1382 | Select a commercial project |
1190 | 1382 | 1383 | ||
1191 | @@ -1404,7 +1405,7 @@ | |||
1192 | 1404 | >>> check_permission('launchpad.ProjectReview', product_set) | 1405 | >>> check_permission('launchpad.ProjectReview', product_set) |
1193 | 1405 | True | 1406 | True |
1194 | 1406 | 1407 | ||
1196 | 1407 | >>> comm_proj_vocab = vocabulary_registry.get(registry_member, "CommercialProjects") | 1408 | >>> comm_proj_vocab = get_naked_vocab(registry_member, "CommercialProjects") |
1197 | 1408 | >>> print comm_proj_vocab.displayname | 1409 | >>> print comm_proj_vocab.displayname |
1198 | 1409 | Select a commercial project | 1410 | Select a commercial project |
1199 | 1410 | 1411 | ||
1200 | 1411 | 1412 | ||
1201 | === modified file 'lib/lp/registry/vocabularies.zcml' | |||
1202 | --- lib/lp/registry/vocabularies.zcml 2009-07-29 03:29:24 +0000 | |||
1203 | +++ lib/lp/registry/vocabularies.zcml 2010-01-18 21:51:20 +0000 | |||
1204 | @@ -3,195 +3,404 @@ | |||
1205 | 3 | --> | 3 | --> |
1206 | 4 | 4 | ||
1207 | 5 | <configure xmlns="http://namespaces.zope.org/zope"> | 5 | <configure xmlns="http://namespaces.zope.org/zope"> |
1209 | 6 | <utility | 6 | <securedutility |
1210 | 7 | name="Distribution" | 7 | name="Distribution" |
1211 | 8 | component="lp.registry.vocabularies.DistributionVocabulary" | 8 | component="lp.registry.vocabularies.DistributionVocabulary" |
1212 | 9 | provides="zope.schema.interfaces.IVocabularyFactory" | 9 | provides="zope.schema.interfaces.IVocabularyFactory" |
1216 | 10 | /> | 10 | > |
1217 | 11 | 11 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1218 | 12 | <utility | 12 | </securedutility> |
1219 | 13 | |||
1220 | 14 | <class class="lp.registry.vocabularies.DistributionVocabulary"> | ||
1221 | 15 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1222 | 16 | </class> | ||
1223 | 17 | |||
1224 | 18 | |||
1225 | 19 | <securedutility | ||
1226 | 13 | name="DistroSeries" | 20 | name="DistroSeries" |
1227 | 14 | component="lp.registry.vocabularies.DistroSeriesVocabulary" | 21 | component="lp.registry.vocabularies.DistroSeriesVocabulary" |
1228 | 15 | provides="zope.schema.interfaces.IVocabularyFactory" | 22 | provides="zope.schema.interfaces.IVocabularyFactory" |
1232 | 16 | /> | 23 | > |
1233 | 17 | 24 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1234 | 18 | <utility | 25 | </securedutility> |
1235 | 26 | |||
1236 | 27 | <class class="lp.registry.vocabularies.DistroSeriesVocabulary"> | ||
1237 | 28 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1238 | 29 | </class> | ||
1239 | 30 | |||
1240 | 31 | |||
1241 | 32 | <securedutility | ||
1242 | 19 | name="FeaturedProject" | 33 | name="FeaturedProject" |
1243 | 20 | component="lp.registry.vocabularies.FeaturedProjectVocabulary" | 34 | component="lp.registry.vocabularies.FeaturedProjectVocabulary" |
1244 | 21 | provides="zope.schema.interfaces.IVocabularyFactory" | 35 | provides="zope.schema.interfaces.IVocabularyFactory" |
1248 | 22 | /> | 36 | > |
1249 | 23 | 37 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1250 | 24 | <utility | 38 | </securedutility> |
1251 | 39 | |||
1252 | 40 | <class class="lp.registry.vocabularies.FeaturedProjectVocabulary"> | ||
1253 | 41 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1254 | 42 | </class> | ||
1255 | 43 | |||
1256 | 44 | |||
1257 | 45 | <securedutility | ||
1258 | 25 | name="FilteredDistroSeries" | 46 | name="FilteredDistroSeries" |
1259 | 26 | component="lp.registry.vocabularies.FilteredDistroSeriesVocabulary" | 47 | component="lp.registry.vocabularies.FilteredDistroSeriesVocabulary" |
1260 | 27 | provides="zope.schema.interfaces.IVocabularyFactory" | 48 | provides="zope.schema.interfaces.IVocabularyFactory" |
1264 | 28 | /> | 49 | > |
1265 | 29 | 50 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1266 | 30 | <utility | 51 | </securedutility> |
1267 | 52 | |||
1268 | 53 | <class class="lp.registry.vocabularies.FilteredDistroSeriesVocabulary"> | ||
1269 | 54 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1270 | 55 | </class> | ||
1271 | 56 | |||
1272 | 57 | |||
1273 | 58 | <securedutility | ||
1274 | 31 | name="FilteredProductSeries" | 59 | name="FilteredProductSeries" |
1275 | 32 | component="lp.registry.vocabularies.FilteredProductSeriesVocabulary" | 60 | component="lp.registry.vocabularies.FilteredProductSeriesVocabulary" |
1276 | 33 | provides="zope.schema.interfaces.IVocabularyFactory" | 61 | provides="zope.schema.interfaces.IVocabularyFactory" |
1280 | 34 | /> | 62 | > |
1281 | 35 | 63 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1282 | 36 | <utility | 64 | </securedutility> |
1283 | 65 | |||
1284 | 66 | <class class="lp.registry.vocabularies.FilteredProductSeriesVocabulary"> | ||
1285 | 67 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1286 | 68 | </class> | ||
1287 | 69 | |||
1288 | 70 | |||
1289 | 71 | <securedutility | ||
1290 | 37 | name="KarmaCategory" | 72 | name="KarmaCategory" |
1291 | 38 | component="lp.registry.vocabularies.KarmaCategoryVocabulary" | 73 | component="lp.registry.vocabularies.KarmaCategoryVocabulary" |
1292 | 39 | provides="zope.schema.interfaces.IVocabularyFactory" | 74 | provides="zope.schema.interfaces.IVocabularyFactory" |
1296 | 40 | /> | 75 | > |
1297 | 41 | 76 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1298 | 42 | <utility | 77 | </securedutility> |
1299 | 78 | |||
1300 | 79 | <class class="lp.registry.vocabularies.KarmaCategoryVocabulary"> | ||
1301 | 80 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1302 | 81 | </class> | ||
1303 | 82 | |||
1304 | 83 | |||
1305 | 84 | <securedutility | ||
1306 | 43 | name="Milestone" | 85 | name="Milestone" |
1307 | 44 | component="lp.registry.vocabularies.MilestoneVocabulary" | 86 | component="lp.registry.vocabularies.MilestoneVocabulary" |
1308 | 45 | provides="zope.schema.interfaces.IVocabularyFactory" | 87 | provides="zope.schema.interfaces.IVocabularyFactory" |
1312 | 46 | /> | 88 | > |
1313 | 47 | 89 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1314 | 48 | <utility | 90 | </securedutility> |
1315 | 91 | |||
1316 | 92 | <class class="lp.registry.vocabularies.MilestoneVocabulary"> | ||
1317 | 93 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1318 | 94 | </class> | ||
1319 | 95 | |||
1320 | 96 | |||
1321 | 97 | <securedutility | ||
1322 | 49 | name="NonMergedPeopleAndTeams" | 98 | name="NonMergedPeopleAndTeams" |
1323 | 50 | component="lp.registry.vocabularies.NonMergedPeopleAndTeamsVocabulary" | 99 | component="lp.registry.vocabularies.NonMergedPeopleAndTeamsVocabulary" |
1324 | 51 | provides="zope.schema.interfaces.IVocabularyFactory" | 100 | provides="zope.schema.interfaces.IVocabularyFactory" |
1328 | 52 | /> | 101 | > |
1329 | 53 | 102 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1330 | 54 | <utility | 103 | </securedutility> |
1331 | 104 | |||
1332 | 105 | <class class="lp.registry.vocabularies.NonMergedPeopleAndTeamsVocabulary"> | ||
1333 | 106 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1334 | 107 | </class> | ||
1335 | 108 | |||
1336 | 109 | |||
1337 | 110 | <securedutility | ||
1338 | 55 | name="AdminMergeablePerson" | 111 | name="AdminMergeablePerson" |
1339 | 56 | component="lp.registry.vocabularies.AdminMergeablePersonVocabulary" | 112 | component="lp.registry.vocabularies.AdminMergeablePersonVocabulary" |
1340 | 57 | provides="zope.schema.interfaces.IVocabularyFactory" | 113 | provides="zope.schema.interfaces.IVocabularyFactory" |
1344 | 58 | /> | 114 | > |
1345 | 59 | 115 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1346 | 60 | <utility | 116 | </securedutility> |
1347 | 117 | |||
1348 | 118 | <class class="lp.registry.vocabularies.AdminMergeablePersonVocabulary"> | ||
1349 | 119 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1350 | 120 | </class> | ||
1351 | 121 | |||
1352 | 122 | |||
1353 | 123 | <securedutility | ||
1354 | 61 | name="PersonAccountToMerge" | 124 | name="PersonAccountToMerge" |
1355 | 62 | component="lp.registry.vocabularies.PersonAccountToMergeVocabulary" | 125 | component="lp.registry.vocabularies.PersonAccountToMergeVocabulary" |
1356 | 63 | provides="zope.schema.interfaces.IVocabularyFactory" | 126 | provides="zope.schema.interfaces.IVocabularyFactory" |
1360 | 64 | /> | 127 | > |
1361 | 65 | 128 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1362 | 66 | <utility | 129 | </securedutility> |
1363 | 130 | |||
1364 | 131 | <class class="lp.registry.vocabularies.PersonAccountToMergeVocabulary"> | ||
1365 | 132 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1366 | 133 | </class> | ||
1367 | 134 | |||
1368 | 135 | |||
1369 | 136 | <securedutility | ||
1370 | 67 | name="PersonActiveMembership" | 137 | name="PersonActiveMembership" |
1371 | 68 | component="lp.registry.vocabularies.PersonActiveMembershipVocabulary" | 138 | component="lp.registry.vocabularies.PersonActiveMembershipVocabulary" |
1372 | 69 | provides="zope.schema.interfaces.IVocabularyFactory" | 139 | provides="zope.schema.interfaces.IVocabularyFactory" |
1376 | 70 | /> | 140 | > |
1377 | 71 | 141 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1378 | 72 | <utility | 142 | </securedutility> |
1379 | 143 | |||
1380 | 144 | <class class="lp.registry.vocabularies.PersonActiveMembershipVocabulary"> | ||
1381 | 145 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1382 | 146 | </class> | ||
1383 | 147 | |||
1384 | 148 | |||
1385 | 149 | <securedutility | ||
1386 | 73 | name="PersonTeamParticipations" | 150 | name="PersonTeamParticipations" |
1387 | 74 | component="lp.registry.vocabularies.person_team_participations_vocabulary_factory" | 151 | component="lp.registry.vocabularies.person_team_participations_vocabulary_factory" |
1388 | 75 | provides="zope.schema.interfaces.IVocabularyFactory" | 152 | provides="zope.schema.interfaces.IVocabularyFactory" |
1392 | 76 | /> | 153 | > |
1393 | 77 | 154 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1394 | 78 | <utility | 155 | </securedutility> |
1395 | 156 | |||
1396 | 157 | |||
1397 | 158 | <securedutility | ||
1398 | 79 | name="Product" | 159 | name="Product" |
1399 | 80 | component="lp.registry.vocabularies.ProductVocabulary" | 160 | component="lp.registry.vocabularies.ProductVocabulary" |
1400 | 81 | provides="zope.schema.interfaces.IVocabularyFactory" | 161 | provides="zope.schema.interfaces.IVocabularyFactory" |
1404 | 82 | /> | 162 | > |
1405 | 83 | 163 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1406 | 84 | <utility | 164 | </securedutility> |
1407 | 165 | |||
1408 | 166 | <class class="lp.registry.vocabularies.ProductVocabulary"> | ||
1409 | 167 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1410 | 168 | </class> | ||
1411 | 169 | |||
1412 | 170 | |||
1413 | 171 | <securedutility | ||
1414 | 85 | name="ProductRelease" | 172 | name="ProductRelease" |
1415 | 86 | component="lp.registry.vocabularies.ProductReleaseVocabulary" | 173 | component="lp.registry.vocabularies.ProductReleaseVocabulary" |
1416 | 87 | provides="zope.schema.interfaces.IVocabularyFactory" | 174 | provides="zope.schema.interfaces.IVocabularyFactory" |
1420 | 88 | /> | 175 | > |
1421 | 89 | 176 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1422 | 90 | <utility | 177 | </securedutility> |
1423 | 178 | |||
1424 | 179 | <class class="lp.registry.vocabularies.ProductReleaseVocabulary"> | ||
1425 | 180 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1426 | 181 | </class> | ||
1427 | 182 | |||
1428 | 183 | |||
1429 | 184 | <securedutility | ||
1430 | 91 | name="ProductSeries" | 185 | name="ProductSeries" |
1431 | 92 | component="lp.registry.vocabularies.ProductSeriesVocabulary" | 186 | component="lp.registry.vocabularies.ProductSeriesVocabulary" |
1432 | 93 | provides="zope.schema.interfaces.IVocabularyFactory" | 187 | provides="zope.schema.interfaces.IVocabularyFactory" |
1436 | 94 | /> | 188 | > |
1437 | 95 | 189 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1438 | 96 | <utility | 190 | </securedutility> |
1439 | 191 | |||
1440 | 192 | <class class="lp.registry.vocabularies.ProductSeriesVocabulary"> | ||
1441 | 193 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1442 | 194 | </class> | ||
1443 | 195 | |||
1444 | 196 | |||
1445 | 197 | <securedutility | ||
1446 | 97 | name="Project" | 198 | name="Project" |
1447 | 98 | component="lp.registry.vocabularies.ProjectVocabulary" | 199 | component="lp.registry.vocabularies.ProjectVocabulary" |
1448 | 99 | provides="zope.schema.interfaces.IVocabularyFactory" | 200 | provides="zope.schema.interfaces.IVocabularyFactory" |
1452 | 100 | /> | 201 | > |
1453 | 101 | 202 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1454 | 102 | <utility | 203 | </securedutility> |
1455 | 204 | |||
1456 | 205 | <class class="lp.registry.vocabularies.ProjectVocabulary"> | ||
1457 | 206 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1458 | 207 | </class> | ||
1459 | 208 | |||
1460 | 209 | |||
1461 | 210 | <securedutility | ||
1462 | 103 | name="ProjectProducts" | 211 | name="ProjectProducts" |
1463 | 104 | component="lp.registry.vocabularies.project_products_vocabulary_factory" | 212 | component="lp.registry.vocabularies.project_products_vocabulary_factory" |
1464 | 105 | provides="zope.schema.interfaces.IVocabularyFactory" | 213 | provides="zope.schema.interfaces.IVocabularyFactory" |
1468 | 106 | /> | 214 | > |
1469 | 107 | 215 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1470 | 108 | <utility | 216 | </securedutility> |
1471 | 217 | |||
1472 | 218 | |||
1473 | 219 | <securedutility | ||
1474 | 109 | name="CommercialProjects" | 220 | name="CommercialProjects" |
1475 | 110 | component="lp.registry.vocabularies.CommercialProjectsVocabulary" | 221 | component="lp.registry.vocabularies.CommercialProjectsVocabulary" |
1476 | 111 | provides="zope.schema.interfaces.IVocabularyFactory" | 222 | provides="zope.schema.interfaces.IVocabularyFactory" |
1480 | 112 | /> | 223 | > |
1481 | 113 | 224 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1482 | 114 | <utility | 225 | </securedutility> |
1483 | 226 | |||
1484 | 227 | <class class="lp.registry.vocabularies.CommercialProjectsVocabulary"> | ||
1485 | 228 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1486 | 229 | </class> | ||
1487 | 230 | |||
1488 | 231 | |||
1489 | 232 | <securedutility | ||
1490 | 115 | name="UserTeamsParticipation" | 233 | name="UserTeamsParticipation" |
1491 | 116 | component="lp.registry.vocabularies.UserTeamsParticipationVocabulary" | 234 | component="lp.registry.vocabularies.UserTeamsParticipationVocabulary" |
1492 | 117 | provides="zope.schema.interfaces.IVocabularyFactory" | 235 | provides="zope.schema.interfaces.IVocabularyFactory" |
1496 | 118 | /> | 236 | > |
1497 | 119 | 237 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1498 | 120 | <utility | 238 | </securedutility> |
1499 | 239 | |||
1500 | 240 | <class class="lp.registry.vocabularies.UserTeamsParticipationVocabulary"> | ||
1501 | 241 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1502 | 242 | </class> | ||
1503 | 243 | |||
1504 | 244 | |||
1505 | 245 | <securedutility | ||
1506 | 121 | name="UserTeamsParticipationPlusSelf" | 246 | name="UserTeamsParticipationPlusSelf" |
1507 | 122 | component="lp.registry.vocabularies.UserTeamsParticipationPlusSelfVocabulary" | 247 | component="lp.registry.vocabularies.UserTeamsParticipationPlusSelfVocabulary" |
1508 | 123 | provides="zope.schema.interfaces.IVocabularyFactory" | 248 | provides="zope.schema.interfaces.IVocabularyFactory" |
1512 | 124 | /> | 249 | > |
1513 | 125 | 250 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1514 | 126 | <utility | 251 | </securedutility> |
1515 | 252 | |||
1516 | 253 | <class class="lp.registry.vocabularies.UserTeamsParticipationPlusSelfVocabulary"> | ||
1517 | 254 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1518 | 255 | </class> | ||
1519 | 256 | |||
1520 | 257 | |||
1521 | 258 | <securedutility | ||
1522 | 127 | name="ActiveMailingList" | 259 | name="ActiveMailingList" |
1523 | 128 | component="lp.registry.vocabularies.ActiveMailingListVocabulary" | 260 | component="lp.registry.vocabularies.ActiveMailingListVocabulary" |
1524 | 129 | provides="zope.schema.interfaces.IVocabularyFactory" | 261 | provides="zope.schema.interfaces.IVocabularyFactory" |
1528 | 130 | /> | 262 | > |
1529 | 131 | 263 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1530 | 132 | <utility | 264 | </securedutility> |
1531 | 265 | |||
1532 | 266 | <class class="lp.registry.vocabularies.ActiveMailingListVocabulary"> | ||
1533 | 267 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1534 | 268 | </class> | ||
1535 | 269 | |||
1536 | 270 | |||
1537 | 271 | <securedutility | ||
1538 | 133 | name="ValidPersonOrTeam" | 272 | name="ValidPersonOrTeam" |
1539 | 134 | component="lp.registry.vocabularies.ValidPersonOrTeamVocabulary" | 273 | component="lp.registry.vocabularies.ValidPersonOrTeamVocabulary" |
1540 | 135 | provides="zope.schema.interfaces.IVocabularyFactory" | 274 | provides="zope.schema.interfaces.IVocabularyFactory" |
1544 | 136 | /> | 275 | > |
1545 | 137 | 276 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1546 | 138 | <utility | 277 | </securedutility> |
1547 | 278 | |||
1548 | 279 | <class class="lp.registry.vocabularies.ValidPersonOrTeamVocabulary"> | ||
1549 | 280 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1550 | 281 | </class> | ||
1551 | 282 | |||
1552 | 283 | |||
1553 | 284 | <securedutility | ||
1554 | 139 | name="ValidAssignee" | 285 | name="ValidAssignee" |
1555 | 140 | component="lp.registry.vocabularies.ValidPersonOrTeamVocabulary" | 286 | component="lp.registry.vocabularies.ValidPersonOrTeamVocabulary" |
1556 | 141 | provides="zope.schema.interfaces.IVocabularyFactory" | 287 | provides="zope.schema.interfaces.IVocabularyFactory" |
1560 | 142 | /> | 288 | > |
1561 | 143 | 289 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1562 | 144 | <utility | 290 | </securedutility> |
1563 | 291 | |||
1564 | 292 | |||
1565 | 293 | <securedutility | ||
1566 | 145 | name="ValidMaintainer" | 294 | name="ValidMaintainer" |
1567 | 146 | component="lp.registry.vocabularies.ValidPersonOrTeamVocabulary" | 295 | component="lp.registry.vocabularies.ValidPersonOrTeamVocabulary" |
1568 | 147 | provides="zope.schema.interfaces.IVocabularyFactory" | 296 | provides="zope.schema.interfaces.IVocabularyFactory" |
1572 | 148 | /> | 297 | > |
1573 | 149 | 298 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1574 | 150 | <utility | 299 | </securedutility> |
1575 | 300 | |||
1576 | 301 | |||
1577 | 302 | <securedutility | ||
1578 | 151 | name="ValidOwner" | 303 | name="ValidOwner" |
1579 | 152 | component="lp.registry.vocabularies.ValidPersonOrTeamVocabulary" | 304 | component="lp.registry.vocabularies.ValidPersonOrTeamVocabulary" |
1580 | 153 | provides="zope.schema.interfaces.IVocabularyFactory" | 305 | provides="zope.schema.interfaces.IVocabularyFactory" |
1584 | 154 | /> | 306 | > |
1585 | 155 | 307 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1586 | 156 | <utility | 308 | </securedutility> |
1587 | 309 | |||
1588 | 310 | |||
1589 | 311 | <securedutility | ||
1590 | 157 | name="ValidTeam" | 312 | name="ValidTeam" |
1591 | 158 | component="lp.registry.vocabularies.ValidTeamVocabulary" | 313 | component="lp.registry.vocabularies.ValidTeamVocabulary" |
1592 | 159 | provides="zope.schema.interfaces.IVocabularyFactory" | 314 | provides="zope.schema.interfaces.IVocabularyFactory" |
1596 | 160 | /> | 315 | > |
1597 | 161 | 316 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1598 | 162 | <utility | 317 | </securedutility> |
1599 | 318 | |||
1600 | 319 | <class class="lp.registry.vocabularies.ValidTeamVocabulary"> | ||
1601 | 320 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1602 | 321 | </class> | ||
1603 | 322 | |||
1604 | 323 | |||
1605 | 324 | <securedutility | ||
1606 | 163 | name="ValidPerson" | 325 | name="ValidPerson" |
1607 | 164 | component="lp.registry.vocabularies.ValidPersonVocabulary" | 326 | component="lp.registry.vocabularies.ValidPersonVocabulary" |
1608 | 165 | provides="zope.schema.interfaces.IVocabularyFactory" | 327 | provides="zope.schema.interfaces.IVocabularyFactory" |
1612 | 166 | /> | 328 | > |
1613 | 167 | 329 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1614 | 168 | <utility | 330 | </securedutility> |
1615 | 331 | |||
1616 | 332 | <class class="lp.registry.vocabularies.ValidPersonVocabulary"> | ||
1617 | 333 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1618 | 334 | </class> | ||
1619 | 335 | |||
1620 | 336 | |||
1621 | 337 | <securedutility | ||
1622 | 169 | name="ValidTeamMember" | 338 | name="ValidTeamMember" |
1623 | 170 | component="lp.registry.vocabularies.ValidTeamMemberVocabulary" | 339 | component="lp.registry.vocabularies.ValidTeamMemberVocabulary" |
1624 | 171 | provides="zope.schema.interfaces.IVocabularyFactory" | 340 | provides="zope.schema.interfaces.IVocabularyFactory" |
1628 | 172 | /> | 341 | > |
1629 | 173 | 342 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1630 | 174 | <utility | 343 | </securedutility> |
1631 | 344 | |||
1632 | 345 | <class class="lp.registry.vocabularies.ValidTeamMemberVocabulary"> | ||
1633 | 346 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1634 | 347 | </class> | ||
1635 | 348 | |||
1636 | 349 | |||
1637 | 350 | <securedutility | ||
1638 | 175 | name="ValidTeamOwner" | 351 | name="ValidTeamOwner" |
1639 | 176 | component="lp.registry.vocabularies.ValidTeamOwnerVocabulary" | 352 | component="lp.registry.vocabularies.ValidTeamOwnerVocabulary" |
1640 | 177 | provides="zope.schema.interfaces.IVocabularyFactory" | 353 | provides="zope.schema.interfaces.IVocabularyFactory" |
1644 | 178 | /> | 354 | > |
1645 | 179 | 355 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1646 | 180 | <utility | 356 | </securedutility> |
1647 | 357 | |||
1648 | 358 | <class class="lp.registry.vocabularies.ValidTeamOwnerVocabulary"> | ||
1649 | 359 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1650 | 360 | </class> | ||
1651 | 361 | |||
1652 | 362 | |||
1653 | 363 | <securedutility | ||
1654 | 181 | name="DistributionOrProduct" | 364 | name="DistributionOrProduct" |
1655 | 182 | component="lp.registry.vocabularies.DistributionOrProductVocabulary" | 365 | component="lp.registry.vocabularies.DistributionOrProductVocabulary" |
1656 | 183 | provides="zope.schema.interfaces.IVocabularyFactory" | 366 | provides="zope.schema.interfaces.IVocabularyFactory" |
1660 | 184 | /> | 367 | > |
1661 | 185 | 368 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1662 | 186 | <utility | 369 | </securedutility> |
1663 | 370 | |||
1664 | 371 | <class class="lp.registry.vocabularies.DistributionOrProductVocabulary"> | ||
1665 | 372 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1666 | 373 | </class> | ||
1667 | 374 | |||
1668 | 375 | |||
1669 | 376 | <securedutility | ||
1670 | 187 | name="DistributionOrProductOrProject" | 377 | name="DistributionOrProductOrProject" |
1671 | 188 | component="lp.registry.vocabularies.DistributionOrProductOrProjectVocabulary" | 378 | component="lp.registry.vocabularies.DistributionOrProductOrProjectVocabulary" |
1672 | 189 | provides="zope.schema.interfaces.IVocabularyFactory" | 379 | provides="zope.schema.interfaces.IVocabularyFactory" |
1676 | 190 | /> | 380 | > |
1677 | 191 | 381 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | |
1678 | 192 | <utility | 382 | </securedutility> |
1679 | 383 | |||
1680 | 384 | <class class="lp.registry.vocabularies.DistributionOrProductOrProjectVocabulary"> | ||
1681 | 385 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1682 | 386 | </class> | ||
1683 | 387 | |||
1684 | 388 | |||
1685 | 389 | <securedutility | ||
1686 | 193 | name="SourcePackageName" | 390 | name="SourcePackageName" |
1687 | 194 | component="lp.registry.vocabularies.SourcePackageNameVocabulary" | 391 | component="lp.registry.vocabularies.SourcePackageNameVocabulary" |
1688 | 195 | provides="zope.schema.interfaces.IVocabularyFactory" | 392 | provides="zope.schema.interfaces.IVocabularyFactory" |
1690 | 196 | /> | 393 | > |
1691 | 394 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | ||
1692 | 395 | </securedutility> | ||
1693 | 396 | |||
1694 | 397 | <class class="lp.registry.vocabularies.SourcePackageNameVocabulary"> | ||
1695 | 398 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1696 | 399 | </class> | ||
1697 | 400 | |||
1698 | 401 | |||
1699 | 402 | <class class="lp.registry.vocabularies.SourcePackageNameIterator"> | ||
1700 | 403 | <allow interface="canonical.launchpad.webapp.vocabulary.ICountableIterator"/> | ||
1701 | 404 | </class> | ||
1702 | 405 | |||
1703 | 197 | </configure> | 406 | </configure> |
1704 | 198 | 407 | ||
1705 | === added file 'lib/lp/services/tests/test_vocabularies.py' | |||
1706 | --- lib/lp/services/tests/test_vocabularies.py 1970-01-01 00:00:00 +0000 | |||
1707 | +++ lib/lp/services/tests/test_vocabularies.py 2010-01-18 21:51:20 +0000 | |||
1708 | @@ -0,0 +1,37 @@ | |||
1709 | 1 | # Copyright 2010 Canonical Ltd. This software is licensed under the | ||
1710 | 2 | # GNU Affero General Public License version 3 (see the file LICENSE). | ||
1711 | 3 | |||
1712 | 4 | """Test registered vocabularies.""" | ||
1713 | 5 | |||
1714 | 6 | __metaclass__ = type | ||
1715 | 7 | __all__ = [] | ||
1716 | 8 | |||
1717 | 9 | import unittest | ||
1718 | 10 | |||
1719 | 11 | from zope.component import getUtilitiesFor | ||
1720 | 12 | from zope.proxy import isProxy | ||
1721 | 13 | from zope.schema.interfaces import IVocabularyFactory | ||
1722 | 14 | from zope.security._proxy import _Proxy | ||
1723 | 15 | |||
1724 | 16 | from canonical.testing.layers import FunctionalLayer | ||
1725 | 17 | from lp.testing import TestCase | ||
1726 | 18 | |||
1727 | 19 | |||
1728 | 20 | class TestVocabularies(TestCase): | ||
1729 | 21 | layer = FunctionalLayer | ||
1730 | 22 | |||
1731 | 23 | def test_security_proxy(self): | ||
1732 | 24 | """Our vocabularies should be registered with <securedutility>.""" | ||
1733 | 25 | vocabularies = getUtilitiesFor(IVocabularyFactory) | ||
1734 | 26 | for name, vocab in vocabularies: | ||
1735 | 27 | # If the vocabulary is not in a security proxy, check | ||
1736 | 28 | # whether it is a vocabulary defined by zope, which are | ||
1737 | 29 | # not registered with <securedutility> and can be ignored. | ||
1738 | 30 | if not isProxy(vocab) and vocab.__module__[:5] != 'zope.': | ||
1739 | 31 | raise AssertionError( | ||
1740 | 32 | '%s.%s vocabulary is not wrapped in a security proxy.' % ( | ||
1741 | 33 | vocab.__module__, name)) | ||
1742 | 34 | |||
1743 | 35 | |||
1744 | 36 | def test_suite(): | ||
1745 | 37 | return unittest.TestLoader().loadTestsFromName(__name__) | ||
1746 | 0 | 38 | ||
1747 | === modified file 'lib/lp/services/worlddata/vocabularies.zcml' | |||
1748 | --- lib/lp/services/worlddata/vocabularies.zcml 2009-07-13 18:15:02 +0000 | |||
1749 | +++ lib/lp/services/worlddata/vocabularies.zcml 2010-01-18 21:51:20 +0000 | |||
1750 | @@ -3,9 +3,12 @@ | |||
1751 | 3 | --> | 3 | --> |
1752 | 4 | 4 | ||
1753 | 5 | <configure xmlns="http://namespaces.zope.org/zope"> | 5 | <configure xmlns="http://namespaces.zope.org/zope"> |
1755 | 6 | <utility | 6 | <securedutility |
1756 | 7 | name="TimezoneName" | 7 | name="TimezoneName" |
1757 | 8 | component="lp.services.worlddata.vocabularies.TimezoneNameVocabulary" | 8 | component="lp.services.worlddata.vocabularies.TimezoneNameVocabulary" |
1758 | 9 | provides="zope.schema.interfaces.IVocabularyFactory" | 9 | provides="zope.schema.interfaces.IVocabularyFactory" |
1760 | 10 | /> | 10 | > |
1761 | 11 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | ||
1762 | 12 | </securedutility> | ||
1763 | 13 | |||
1764 | 11 | </configure> | 14 | </configure> |
1765 | 12 | 15 | ||
1766 | === modified file 'lib/lp/soyuz/configure.zcml' | |||
1767 | --- lib/lp/soyuz/configure.zcml 2010-01-14 03:39:27 +0000 | |||
1768 | +++ lib/lp/soyuz/configure.zcml 2010-01-18 21:51:20 +0000 | |||
1769 | @@ -260,10 +260,24 @@ | |||
1770 | 260 | <allow | 260 | <allow |
1771 | 261 | interface="lp.soyuz.interfaces.binarypackagename.IBinaryPackageName"/> | 261 | interface="lp.soyuz.interfaces.binarypackagename.IBinaryPackageName"/> |
1772 | 262 | </class> | 262 | </class> |
1774 | 263 | <utility | 263 | <securedutility |
1775 | 264 | name="BinaryPackageName" | 264 | name="BinaryPackageName" |
1776 | 265 | component="lp.soyuz.model.binarypackagename.BinaryPackageNameVocabulary" | 265 | component="lp.soyuz.model.binarypackagename.BinaryPackageNameVocabulary" |
1778 | 266 | provides="zope.schema.interfaces.IVocabularyFactory"/> | 266 | provides="zope.schema.interfaces.IVocabularyFactory"> |
1779 | 267 | <allow interface="zope.schema.interfaces.IVocabularyFactory"/> | ||
1780 | 268 | </securedutility> | ||
1781 | 269 | |||
1782 | 270 | <class class="lp.soyuz.model.binarypackagename.BinaryPackageNameVocabulary"> | ||
1783 | 271 | <allow interface="canonical.launchpad.webapp.vocabulary.IHugeVocabulary"/> | ||
1784 | 272 | </class> | ||
1785 | 273 | |||
1786 | 274 | <!-- BinaryPackagenameIterator --> | ||
1787 | 275 | |||
1788 | 276 | <class | ||
1789 | 277 | class="lp.soyuz.model.binarypackagename.BinaryPackageNameIterator"> | ||
1790 | 278 | <allow | ||
1791 | 279 | interface="canonical.launchpad.webapp.vocabulary.ICountableIterator"/> | ||
1792 | 280 | </class> | ||
1793 | 267 | 281 | ||
1794 | 268 | <!-- BinaryPackageNameSet --> | 282 | <!-- BinaryPackageNameSet --> |
1795 | 269 | 283 | ||
1796 | 270 | 284 | ||
1797 | === modified file 'lib/lp/soyuz/interfaces/binarypackagename.py' | |||
1798 | --- lib/lp/soyuz/interfaces/binarypackagename.py 2009-06-25 04:06:00 +0000 | |||
1799 | +++ lib/lp/soyuz/interfaces/binarypackagename.py 2010-01-18 21:51:20 +0000 | |||
1800 | @@ -84,6 +84,7 @@ | |||
1801 | 84 | to report a bug in. | 84 | to report a bug in. |
1802 | 85 | """ | 85 | """ |
1803 | 86 | 86 | ||
1804 | 87 | id = Int(title=_('ID'), required=True, readonly=True) | ||
1805 | 88 | |||
1806 | 87 | name = TextLine(title=_('Binary or Source package name'), | 89 | name = TextLine(title=_('Binary or Source package name'), |
1807 | 88 | required=True, constraint=name_validator) | 90 | required=True, constraint=name_validator) |
1808 | 89 |
Summary
-------
Registered all the Launchpad vocabularies with <securedutility>
instead of <utility> so that it will not be possible to get
a db object without a security proxy.
This required an <allow> block on each utility to allow tory).
access to the __call__ method on the vocabulary class (IVocabularyFac
The vocabulary objects required a <class> directive with IHugeVocabulary >.
<allow interface=
Some vocabulary factories were actually functions, such as eriesVocabulary , which would actually return either roductSeriesVoc abulary or BugNominatableD istroSeriesVoca bulary
BugNominatableS
BugNominatableP
objects.
Implementation details ------- ------- -
-------
New tests: lp/services/ tests/test_ vocabularies. py canonical/ launchpad/ doc/vocabulary- json.txt
lib/
lib/
Indicate in the picker widget when email address is hidden. canonical/ launchpad/ browser/ vocabulary. py
lib/
Some vocabularies need to get the IBinaryAndSourc ePackageName. id lp/soyuz/ interfaces/ binarypackagena me.py
attribute from objects that were passed in from widgets, so they
are already security proxied.
lib/
Fixed tests that broke since they were accessing methods that canonical/ launchpad/ doc/vocabularie s.txt lp/answers/ doc/faq- vocabulary. txt lp/registry/ doc/vocabularie s.txt
should not be exposed through the security proxy.
lib/
lib/
lib/
Since vocabularies must be registered with a name parameter, canonical/ launchpad/ webapp/ metazcml. py
the <securedutility> directive needed to be updated to pass
this along to the underlying <utility>.
lib/
Added BugNominatableD istroSeriesVoca bulary and roductSeriesVoc abulary to __all__. canonical/ launchpad/ vocabularies/ dbobjects. py
BugNominatableP
lib/
ICountableIterator defines a __getitem__ method that provides canonical/ launchpad/ webapp/ configure. zcml
the __getslice__ functionality.
lib/
Somewhat interesting zcml changes: canonical/ launchpad/ zcml/binaryands ourcepackagenam e.zcml lp/soyuz/ configure. zcml
lib/
lib/
The changes for SimpleVocabulary, SimpleTerm, and SeriesVocabular y are the only parts of note among the canonical/ launchpad/ vocabularies/ configure. zcml
BugNominatable*
many changes in this file.
lib/
TimezoneNameVoc abulary is just a function that returns a lp/services/ worlddata/ vocabularies. zcml
SimpleVocabulary, so it doesn't need any <class> directives.
lib/
Uninteresting bulk changes to use <securedutility>: lp/answers/ configure. zcml lp/registry/ vocabularies. zcml
lib/
lib/
Tests
-----
./bin/test -vv -t 'test_vocabular ies|vocabulary- json.txt'
Demo and Q/A
------------
* Open https:/ /launchpad. dev/people/ +requestmerge
* Click on "Choose" to bring up the picker.
* Search for "name12".
* The email address should be hidden.