Merge lp:~cprov/launchpad/bug-422965-archive-permission-api into lp:launchpad
- bug-422965-archive-permission-api
- Merge into devel
Proposed by
Celso Providelo
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~cprov/launchpad/bug-422965-archive-permission-api |
Merge into: | lp:launchpad |
Diff against target: | None lines |
To merge this branch: | bzr merge lp:~cprov/launchpad/bug-422965-archive-permission-api |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | Approve | ||
Review via email: mp+12006@code.launchpad.net |
Commit message
Description of the change
To post a comment you must log in.
Revision history for this message
Celso Providelo (cprov) wrote : | # |
Revision history for this message
Paul Hummer (rockstar) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'lib/lp/soyuz/configure.zcml' | |||
2 | --- lib/lp/soyuz/configure.zcml 2009-09-03 15:04:13 +0000 | |||
3 | +++ lib/lp/soyuz/configure.zcml 2009-09-04 18:18:39 +0000 | |||
4 | @@ -394,6 +394,7 @@ | |||
5 | 394 | interface="lp.soyuz.interfaces.archive.IArchiveAppend"/> | 394 | interface="lp.soyuz.interfaces.archive.IArchiveAppend"/> |
6 | 395 | <require | 395 | <require |
7 | 396 | permission="launchpad.Edit" | 396 | permission="launchpad.Edit" |
8 | 397 | interface="lp.soyuz.interfaces.archive.IArchiveEdit" | ||
9 | 397 | set_attributes="description displayname"/> | 398 | set_attributes="description displayname"/> |
10 | 398 | <require | 399 | <require |
11 | 399 | permission="launchpad.Commercial" | 400 | permission="launchpad.Commercial" |
12 | @@ -465,16 +466,16 @@ | |||
13 | 465 | packagesetsForUploader | 466 | packagesetsForUploader |
14 | 466 | packagesetsForSource | 467 | packagesetsForSource |
15 | 467 | packagesetsForSourceUploader | 468 | packagesetsForSourceUploader |
20 | 468 | isSourceUploadAllowed"/> | 469 | isSourceUploadAllowed |
17 | 469 | <require | ||
18 | 470 | permission="launchpad.Edit" | ||
19 | 471 | attributes=" | ||
21 | 472 | newPackageUploader | 470 | newPackageUploader |
22 | 473 | newComponentUploader | 471 | newComponentUploader |
23 | 474 | newQueueAdmin | 472 | newQueueAdmin |
24 | 475 | deletePackageUploader | 473 | deletePackageUploader |
25 | 476 | deleteComponentUploader | 474 | deleteComponentUploader |
27 | 477 | deleteQueueAdmin | 475 | deleteQueueAdmin"/> |
28 | 476 | <require | ||
29 | 477 | permission="launchpad.Edit" | ||
30 | 478 | attributes=" | ||
31 | 478 | newPackagesetUploader | 479 | newPackagesetUploader |
32 | 479 | deletePackagesetUploader"/> | 480 | deletePackagesetUploader"/> |
33 | 480 | </securedutility> | 481 | </securedutility> |
34 | 481 | 482 | ||
35 | === modified file 'lib/lp/soyuz/interfaces/archive.py' | |||
36 | --- lib/lp/soyuz/interfaces/archive.py 2009-09-02 21:28:11 +0000 | |||
37 | +++ lib/lp/soyuz/interfaces/archive.py 2009-09-17 17:24:04 +0000 | |||
38 | @@ -16,6 +16,7 @@ | |||
39 | 16 | 'DistroSeriesNotFound', | 16 | 'DistroSeriesNotFound', |
40 | 17 | 'IArchive', | 17 | 'IArchive', |
41 | 18 | 'IArchiveAppend', | 18 | 'IArchiveAppend', |
42 | 19 | 'IArchiveEdit', | ||
43 | 19 | 'IArchiveView', | 20 | 'IArchiveView', |
44 | 20 | 'IArchiveEditDependenciesForm', | 21 | 'IArchiveEditDependenciesForm', |
45 | 21 | 'IArchivePublic', | 22 | 'IArchivePublic', |
46 | @@ -336,68 +337,6 @@ | |||
47 | 336 | :return: A list of `IArchivePermission` records. | 337 | :return: A list of `IArchivePermission` records. |
48 | 337 | """ | 338 | """ |
49 | 338 | 339 | ||
50 | 339 | @operation_parameters(person=Reference(schema=IPerson)) | ||
51 | 340 | # Really IArchivePermission, set below to avoid circular import. | ||
52 | 341 | @operation_returns_collection_of(Interface) | ||
53 | 342 | @export_read_operation() | ||
54 | 343 | def getPermissionsForPerson(person): | ||
55 | 344 | """Return the `IArchivePermission` records applicable to the person. | ||
56 | 345 | |||
57 | 346 | :param person: An `IPerson` | ||
58 | 347 | :return: A list of `IArchivePermission` records. | ||
59 | 348 | """ | ||
60 | 349 | |||
61 | 350 | @operation_parameters( | ||
62 | 351 | source_package_name=TextLine( | ||
63 | 352 | title=_("Source Package Name"), required=True)) | ||
64 | 353 | # Really IArchivePermission, set below to avoid circular import. | ||
65 | 354 | @operation_returns_collection_of(Interface) | ||
66 | 355 | @export_read_operation() | ||
67 | 356 | def getUploadersForPackage(source_package_name): | ||
68 | 357 | """Return `IArchivePermission` records for the package's uploaders. | ||
69 | 358 | |||
70 | 359 | :param source_package_name: An `ISourcePackageName` or textual name | ||
71 | 360 | for the source package. | ||
72 | 361 | :return: A list of `IArchivePermission` records. | ||
73 | 362 | """ | ||
74 | 363 | |||
75 | 364 | @operation_parameters( | ||
76 | 365 | component_name=TextLine(title=_("Component Name"), required=False)) | ||
77 | 366 | # Really IArchivePermission, set below to avoid circular import. | ||
78 | 367 | @operation_returns_collection_of(Interface) | ||
79 | 368 | @export_read_operation() | ||
80 | 369 | def getUploadersForComponent(component_name=None): | ||
81 | 370 | """Return `IArchivePermission` records for the component's uploaders. | ||
82 | 371 | |||
83 | 372 | :param component_name: An `IComponent` or textual name for the | ||
84 | 373 | component. | ||
85 | 374 | :return: A list of `IArchivePermission` records. | ||
86 | 375 | """ | ||
87 | 376 | |||
88 | 377 | @operation_parameters( | ||
89 | 378 | component_name=TextLine(title=_("Component Name"), required=True)) | ||
90 | 379 | # Really IArchivePermission, set below to avoid circular import. | ||
91 | 380 | @operation_returns_collection_of(Interface) | ||
92 | 381 | @export_read_operation() | ||
93 | 382 | def getQueueAdminsForComponent(component_name): | ||
94 | 383 | """Return `IArchivePermission` records for authorised queue admins. | ||
95 | 384 | |||
96 | 385 | :param component_name: An `IComponent` or textual name for the | ||
97 | 386 | component. | ||
98 | 387 | :return: A list of `IArchivePermission` records. | ||
99 | 388 | """ | ||
100 | 389 | |||
101 | 390 | @operation_parameters(person=Reference(schema=IPerson)) | ||
102 | 391 | # Really IArchivePermission, set below to avoid circular import. | ||
103 | 392 | @operation_returns_collection_of(Interface) | ||
104 | 393 | @export_read_operation() | ||
105 | 394 | def getComponentsForQueueAdmin(person): | ||
106 | 395 | """Return `IArchivePermission` for the person's queue admin components | ||
107 | 396 | |||
108 | 397 | :param person: An `IPerson` | ||
109 | 398 | :return: A list of `IArchivePermission` records. | ||
110 | 399 | """ | ||
111 | 400 | |||
112 | 401 | def canUpload(person, component_or_package=None): | 340 | def canUpload(person, component_or_package=None): |
113 | 402 | """Check to see if person is allowed to upload to component. | 341 | """Check to see if person is allowed to upload to component. |
114 | 403 | 342 | ||
115 | @@ -423,103 +362,6 @@ | |||
116 | 423 | queue for items with 'component'. | 362 | queue for items with 'component'. |
117 | 424 | """ | 363 | """ |
118 | 425 | 364 | ||
119 | 426 | # The following three factory methods are not in the | ||
120 | 427 | # IArchiveEditRestricted interface because the rights to use them | ||
121 | 428 | # does not depend on edit permissions to the archive. The code they | ||
122 | 429 | # contain does all the necessary security checking and is well | ||
123 | 430 | # tested in xx-archive.txt and archivepermissions.txt. | ||
124 | 431 | |||
125 | 432 | @operation_parameters( | ||
126 | 433 | person=Reference(schema=IPerson), | ||
127 | 434 | source_package_name=TextLine( | ||
128 | 435 | title=_("Source Package Name"), required=True)) | ||
129 | 436 | # Really IArchivePermission, set below to avoid circular import. | ||
130 | 437 | @export_factory_operation(Interface, []) | ||
131 | 438 | def newPackageUploader(person, source_package_name): | ||
132 | 439 | """Add permisson for a person to upload a package to this archive. | ||
133 | 440 | |||
134 | 441 | :param person: An `IPerson` whom should be given permission. | ||
135 | 442 | :param source_package_name: An `ISourcePackageName` or textual package | ||
136 | 443 | name. | ||
137 | 444 | :return: An `IArchivePermission` which is the newly-created | ||
138 | 445 | permission. | ||
139 | 446 | """ | ||
140 | 447 | |||
141 | 448 | @operation_parameters( | ||
142 | 449 | person=Reference(schema=IPerson), | ||
143 | 450 | component_name=TextLine( | ||
144 | 451 | title=_("Component Name"), required=True)) | ||
145 | 452 | # Really IArchivePermission, set below to avoid circular import. | ||
146 | 453 | @export_factory_operation(Interface, []) | ||
147 | 454 | def newComponentUploader(person, component_name): | ||
148 | 455 | """Add permission for a person to upload to a component. | ||
149 | 456 | |||
150 | 457 | :param person: An `IPerson` whom should be given permission. | ||
151 | 458 | :param component: An `IComponent` or textual component name. | ||
152 | 459 | :return: An `IArchivePermission` which is the newly-created | ||
153 | 460 | permission. | ||
154 | 461 | :raises InvalidComponent: if this archive is a PPA and the component | ||
155 | 462 | is not 'main'. | ||
156 | 463 | """ | ||
157 | 464 | |||
158 | 465 | @operation_parameters( | ||
159 | 466 | person=Reference(schema=IPerson), | ||
160 | 467 | component_name=TextLine( | ||
161 | 468 | title=_("Component Name"), required=True)) | ||
162 | 469 | # Really IArchivePermission, set below to avoid circular import. | ||
163 | 470 | @export_factory_operation(Interface, []) | ||
164 | 471 | def newQueueAdmin(person, component_name): | ||
165 | 472 | """Add permission for a person to administer a distroseries queue. | ||
166 | 473 | |||
167 | 474 | The supplied person will gain permission to administer the | ||
168 | 475 | distroseries queue for packages in the supplied component. | ||
169 | 476 | |||
170 | 477 | :param person: An `IPerson` whom should be given permission. | ||
171 | 478 | :param component: An `IComponent` or textual component name. | ||
172 | 479 | :return: An `IArchivePermission` which is the newly-created | ||
173 | 480 | permission. | ||
174 | 481 | """ | ||
175 | 482 | |||
176 | 483 | @operation_parameters( | ||
177 | 484 | person=Reference(schema=IPerson), | ||
178 | 485 | source_package_name=TextLine( | ||
179 | 486 | title=_("Source Package Name"), required=True)) | ||
180 | 487 | @export_write_operation() | ||
181 | 488 | def deletePackageUploader(person, source_package_name): | ||
182 | 489 | """Revoke permission for the person to upload the package. | ||
183 | 490 | |||
184 | 491 | :param person: An `IPerson` whose permission should be revoked. | ||
185 | 492 | :param source_package_name: An `ISourcePackageName` or textual package | ||
186 | 493 | name. | ||
187 | 494 | """ | ||
188 | 495 | |||
189 | 496 | @operation_parameters( | ||
190 | 497 | person=Reference(schema=IPerson), | ||
191 | 498 | component_name=TextLine( | ||
192 | 499 | title=_("Component Name"), required=True)) | ||
193 | 500 | @export_write_operation() | ||
194 | 501 | def deleteComponentUploader(person, component_name): | ||
195 | 502 | """Revoke permission for the person to upload to the component. | ||
196 | 503 | |||
197 | 504 | :param person: An `IPerson` whose permission should be revoked. | ||
198 | 505 | :param component: An `IComponent` or textual component name. | ||
199 | 506 | """ | ||
200 | 507 | |||
201 | 508 | @operation_parameters( | ||
202 | 509 | person=Reference(schema=IPerson), | ||
203 | 510 | component_name=TextLine( | ||
204 | 511 | title=_("Component Name"), required=True)) | ||
205 | 512 | @export_write_operation() | ||
206 | 513 | def deleteQueueAdmin(person, component_name): | ||
207 | 514 | """Revoke permission for the person to administer distroseries queues. | ||
208 | 515 | |||
209 | 516 | The supplied person will lose permission to administer the | ||
210 | 517 | distroseries queue for packages in the supplied component. | ||
211 | 518 | |||
212 | 519 | :param person: An `IPerson` whose permission should be revoked. | ||
213 | 520 | :param component: An `IComponent` or textual component name. | ||
214 | 521 | """ | ||
215 | 522 | |||
216 | 523 | def getFileByName(filename): | 365 | def getFileByName(filename): |
217 | 524 | """Return the corresponding `ILibraryFileAlias` in this context. | 366 | """Return the corresponding `ILibraryFileAlias` in this context. |
218 | 525 | 367 | ||
219 | @@ -926,6 +768,68 @@ | |||
220 | 926 | could not be found. | 768 | could not be found. |
221 | 927 | """ | 769 | """ |
222 | 928 | 770 | ||
223 | 771 | @operation_parameters(person=Reference(schema=IPerson)) | ||
224 | 772 | # Really IArchivePermission, set below to avoid circular import. | ||
225 | 773 | @operation_returns_collection_of(Interface) | ||
226 | 774 | @export_read_operation() | ||
227 | 775 | def getPermissionsForPerson(person): | ||
228 | 776 | """Return the `IArchivePermission` records applicable to the person. | ||
229 | 777 | |||
230 | 778 | :param person: An `IPerson` | ||
231 | 779 | :return: A list of `IArchivePermission` records. | ||
232 | 780 | """ | ||
233 | 781 | |||
234 | 782 | @operation_parameters( | ||
235 | 783 | source_package_name=TextLine( | ||
236 | 784 | title=_("Source Package Name"), required=True)) | ||
237 | 785 | # Really IArchivePermission, set below to avoid circular import. | ||
238 | 786 | @operation_returns_collection_of(Interface) | ||
239 | 787 | @export_read_operation() | ||
240 | 788 | def getUploadersForPackage(source_package_name): | ||
241 | 789 | """Return `IArchivePermission` records for the package's uploaders. | ||
242 | 790 | |||
243 | 791 | :param source_package_name: An `ISourcePackageName` or textual name | ||
244 | 792 | for the source package. | ||
245 | 793 | :return: A list of `IArchivePermission` records. | ||
246 | 794 | """ | ||
247 | 795 | |||
248 | 796 | @operation_parameters( | ||
249 | 797 | component_name=TextLine(title=_("Component Name"), required=False)) | ||
250 | 798 | # Really IArchivePermission, set below to avoid circular import. | ||
251 | 799 | @operation_returns_collection_of(Interface) | ||
252 | 800 | @export_read_operation() | ||
253 | 801 | def getUploadersForComponent(component_name=None): | ||
254 | 802 | """Return `IArchivePermission` records for the component's uploaders. | ||
255 | 803 | |||
256 | 804 | :param component_name: An `IComponent` or textual name for the | ||
257 | 805 | component. | ||
258 | 806 | :return: A list of `IArchivePermission` records. | ||
259 | 807 | """ | ||
260 | 808 | |||
261 | 809 | @operation_parameters( | ||
262 | 810 | component_name=TextLine(title=_("Component Name"), required=True)) | ||
263 | 811 | # Really IArchivePermission, set below to avoid circular import. | ||
264 | 812 | @operation_returns_collection_of(Interface) | ||
265 | 813 | @export_read_operation() | ||
266 | 814 | def getQueueAdminsForComponent(component_name): | ||
267 | 815 | """Return `IArchivePermission` records for authorised queue admins. | ||
268 | 816 | |||
269 | 817 | :param component_name: An `IComponent` or textual name for the | ||
270 | 818 | component. | ||
271 | 819 | :return: A list of `IArchivePermission` records. | ||
272 | 820 | """ | ||
273 | 821 | |||
274 | 822 | @operation_parameters(person=Reference(schema=IPerson)) | ||
275 | 823 | # Really IArchivePermission, set below to avoid circular import. | ||
276 | 824 | @operation_returns_collection_of(Interface) | ||
277 | 825 | @export_read_operation() | ||
278 | 826 | def getComponentsForQueueAdmin(person): | ||
279 | 827 | """Return `IArchivePermission` for the person's queue admin components | ||
280 | 828 | |||
281 | 829 | :param person: An `IPerson` | ||
282 | 830 | :return: A list of `IArchivePermission` records. | ||
283 | 831 | """ | ||
284 | 832 | |||
285 | 929 | 833 | ||
286 | 930 | class IArchiveAppend(Interface): | 834 | class IArchiveAppend(Interface): |
287 | 931 | """Archive interface for operations restricted by append privilege.""" | 835 | """Archive interface for operations restricted by append privilege.""" |
288 | @@ -1043,7 +947,102 @@ | |||
289 | 1043 | """ | 947 | """ |
290 | 1044 | 948 | ||
291 | 1045 | 949 | ||
293 | 1046 | class IArchive(IArchivePublic, IArchiveAppend, IArchiveView): | 950 | class IArchiveEdit(Interface): |
294 | 951 | """Archive interface for operations restricted by edit privilege.""" | ||
295 | 952 | |||
296 | 953 | @operation_parameters( | ||
297 | 954 | person=Reference(schema=IPerson), | ||
298 | 955 | source_package_name=TextLine( | ||
299 | 956 | title=_("Source Package Name"), required=True)) | ||
300 | 957 | # Really IArchivePermission, set below to avoid circular import. | ||
301 | 958 | @export_factory_operation(Interface, []) | ||
302 | 959 | def newPackageUploader(person, source_package_name): | ||
303 | 960 | """Add permisson for a person to upload a package to this archive. | ||
304 | 961 | |||
305 | 962 | :param person: An `IPerson` whom should be given permission. | ||
306 | 963 | :param source_package_name: An `ISourcePackageName` or textual package | ||
307 | 964 | name. | ||
308 | 965 | :return: An `IArchivePermission` which is the newly-created | ||
309 | 966 | permission. | ||
310 | 967 | """ | ||
311 | 968 | |||
312 | 969 | @operation_parameters( | ||
313 | 970 | person=Reference(schema=IPerson), | ||
314 | 971 | component_name=TextLine( | ||
315 | 972 | title=_("Component Name"), required=True)) | ||
316 | 973 | # Really IArchivePermission, set below to avoid circular import. | ||
317 | 974 | @export_factory_operation(Interface, []) | ||
318 | 975 | def newComponentUploader(person, component_name): | ||
319 | 976 | """Add permission for a person to upload to a component. | ||
320 | 977 | |||
321 | 978 | :param person: An `IPerson` whom should be given permission. | ||
322 | 979 | :param component: An `IComponent` or textual component name. | ||
323 | 980 | :return: An `IArchivePermission` which is the newly-created | ||
324 | 981 | permission. | ||
325 | 982 | :raises InvalidComponent: if this archive is a PPA and the component | ||
326 | 983 | is not 'main'. | ||
327 | 984 | """ | ||
328 | 985 | |||
329 | 986 | @operation_parameters( | ||
330 | 987 | person=Reference(schema=IPerson), | ||
331 | 988 | component_name=TextLine( | ||
332 | 989 | title=_("Component Name"), required=True)) | ||
333 | 990 | # Really IArchivePermission, set below to avoid circular import. | ||
334 | 991 | @export_factory_operation(Interface, []) | ||
335 | 992 | def newQueueAdmin(person, component_name): | ||
336 | 993 | """Add permission for a person to administer a distroseries queue. | ||
337 | 994 | |||
338 | 995 | The supplied person will gain permission to administer the | ||
339 | 996 | distroseries queue for packages in the supplied component. | ||
340 | 997 | |||
341 | 998 | :param person: An `IPerson` whom should be given permission. | ||
342 | 999 | :param component: An `IComponent` or textual component name. | ||
343 | 1000 | :return: An `IArchivePermission` which is the newly-created | ||
344 | 1001 | permission. | ||
345 | 1002 | """ | ||
346 | 1003 | |||
347 | 1004 | @operation_parameters( | ||
348 | 1005 | person=Reference(schema=IPerson), | ||
349 | 1006 | source_package_name=TextLine( | ||
350 | 1007 | title=_("Source Package Name"), required=True)) | ||
351 | 1008 | @export_write_operation() | ||
352 | 1009 | def deletePackageUploader(person, source_package_name): | ||
353 | 1010 | """Revoke permission for the person to upload the package. | ||
354 | 1011 | |||
355 | 1012 | :param person: An `IPerson` whose permission should be revoked. | ||
356 | 1013 | :param source_package_name: An `ISourcePackageName` or textual package | ||
357 | 1014 | name. | ||
358 | 1015 | """ | ||
359 | 1016 | |||
360 | 1017 | @operation_parameters( | ||
361 | 1018 | person=Reference(schema=IPerson), | ||
362 | 1019 | component_name=TextLine( | ||
363 | 1020 | title=_("Component Name"), required=True)) | ||
364 | 1021 | @export_write_operation() | ||
365 | 1022 | def deleteComponentUploader(person, component_name): | ||
366 | 1023 | """Revoke permission for the person to upload to the component. | ||
367 | 1024 | |||
368 | 1025 | :param person: An `IPerson` whose permission should be revoked. | ||
369 | 1026 | :param component: An `IComponent` or textual component name. | ||
370 | 1027 | """ | ||
371 | 1028 | |||
372 | 1029 | @operation_parameters( | ||
373 | 1030 | person=Reference(schema=IPerson), | ||
374 | 1031 | component_name=TextLine( | ||
375 | 1032 | title=_("Component Name"), required=True)) | ||
376 | 1033 | @export_write_operation() | ||
377 | 1034 | def deleteQueueAdmin(person, component_name): | ||
378 | 1035 | """Revoke permission for the person to administer distroseries queues. | ||
379 | 1036 | |||
380 | 1037 | The supplied person will lose permission to administer the | ||
381 | 1038 | distroseries queue for packages in the supplied component. | ||
382 | 1039 | |||
383 | 1040 | :param person: An `IPerson` whose permission should be revoked. | ||
384 | 1041 | :param component: An `IComponent` or textual component name. | ||
385 | 1042 | """ | ||
386 | 1043 | |||
387 | 1044 | |||
388 | 1045 | class IArchive(IArchivePublic, IArchiveAppend, IArchiveEdit, IArchiveView): | ||
389 | 1047 | """Main Archive interface.""" | 1046 | """Main Archive interface.""" |
390 | 1048 | export_as_webservice_entry() | 1047 | export_as_webservice_entry() |
391 | 1049 | 1048 | ||
392 | 1050 | 1049 | ||
393 | === modified file 'lib/lp/soyuz/stories/webservice/xx-archive.txt' | |||
394 | --- lib/lp/soyuz/stories/webservice/xx-archive.txt 2009-09-04 07:29:56 +0000 | |||
395 | +++ lib/lp/soyuz/stories/webservice/xx-archive.txt 2009-09-04 18:18:39 +0000 | |||
396 | @@ -76,9 +76,9 @@ | |||
397 | 76 | 76 | ||
398 | 77 | The archive has the following attributes: | 77 | The archive has the following attributes: |
399 | 78 | 78 | ||
401 | 79 | >>> main_archive = webservice.get( | 79 | >>> ubuntu_main_archive = webservice.get( |
402 | 80 | ... ubuntutest['main_archive_link']).jsonBody() | 80 | ... ubuntutest['main_archive_link']).jsonBody() |
404 | 81 | >>> pprint_entry(main_archive) | 81 | >>> pprint_entry(ubuntu_main_archive) |
405 | 82 | dependencies_collection_link: u'http://.../ubuntutest/+archive/primary/dependencies' | 82 | dependencies_collection_link: u'http://.../ubuntutest/+archive/primary/dependencies' |
406 | 83 | description: None | 83 | description: None |
407 | 84 | displayname: u'Primary Archive for Ubuntu Test' | 84 | displayname: u'Primary Archive for Ubuntu Test' |
408 | @@ -186,10 +186,10 @@ | |||
409 | 186 | Permission collections can be retrieved with custom operations on the | 186 | Permission collections can be retrieved with custom operations on the |
410 | 187 | archive. | 187 | archive. |
411 | 188 | 188 | ||
413 | 189 | getPermissionsForPerson returns all the permissions that a user has. | 189 | `getPermissionsForPerson` returns all the permissions that a user has. |
414 | 190 | 190 | ||
417 | 191 | >>> ubuntu_team = webservice.get("/~ubuntu-team").jsonBody() | 191 | >>> ubuntu_team = user_webservice.get("/~ubuntu-team").jsonBody() |
418 | 192 | >>> permissions = webservice.named_get( | 192 | >>> permissions = user_webservice.named_get( |
419 | 193 | ... ubuntutest['main_archive_link'], 'getPermissionsForPerson', | 193 | ... ubuntutest['main_archive_link'], 'getPermissionsForPerson', |
420 | 194 | ... person=ubuntu_team['self_link']).jsonBody() | 194 | ... person=ubuntu_team['self_link']).jsonBody() |
421 | 195 | 195 | ||
422 | @@ -211,11 +211,11 @@ | |||
423 | 211 | Archive Upload Rights ...~ubuntu-team main None | 211 | Archive Upload Rights ...~ubuntu-team main None |
424 | 212 | Archive Upload Rights ...~ubuntu-team universe None | 212 | Archive Upload Rights ...~ubuntu-team universe None |
425 | 213 | 213 | ||
427 | 214 | getUploadersForPackage returns all the permissions where someone can | 214 | `getUploadersForPackage` returns all the permissions where someone can |
428 | 215 | upload a particular package. | 215 | upload a particular package. |
429 | 216 | 216 | ||
430 | 217 | >>> def show_mozilla_permissions(): | 217 | >>> def show_mozilla_permissions(): |
432 | 218 | ... permissions = webservice.named_get( | 218 | ... permissions = user_webservice.named_get( |
433 | 219 | ... ubuntu['main_archive_link'], 'getUploadersForPackage', | 219 | ... ubuntu['main_archive_link'], 'getUploadersForPackage', |
434 | 220 | ... source_package_name='mozilla-firefox').jsonBody() | 220 | ... source_package_name='mozilla-firefox').jsonBody() |
435 | 221 | ... show_permission_entries(permissions) | 221 | ... show_permission_entries(permissions) |
436 | @@ -225,17 +225,35 @@ | |||
437 | 225 | 225 | ||
438 | 226 | Passing a bad package name results in an error: | 226 | Passing a bad package name results in an error: |
439 | 227 | 227 | ||
441 | 228 | >>> print webservice.named_get( | 228 | >>> print user_webservice.named_get( |
442 | 229 | ... ubuntu['main_archive_link'], 'getUploadersForPackage', | 229 | ... ubuntu['main_archive_link'], 'getUploadersForPackage', |
443 | 230 | ... source_package_name="badpackage") | 230 | ... source_package_name="badpackage") |
444 | 231 | HTTP/1.1 400 Bad Request | 231 | HTTP/1.1 400 Bad Request |
445 | 232 | ... | 232 | ... |
446 | 233 | 233 | ||
449 | 234 | newPackageUploader() is a factory function that adds a new permission for | 234 | Colin is a valid member of the team who owns the ubuntu primary archive. |
450 | 235 | a person to upload a package. | 235 | |
451 | 236 | >>> from canonical.launchpad.testing.pages import webservice_for_person | ||
452 | 237 | >>> from canonical.launchpad.webapp.interfaces import OAuthPermission | ||
453 | 238 | >>> from lp.registry.interfaces.distribution import IDistributionSet | ||
454 | 239 | |||
455 | 240 | >>> login(ANONYMOUS) | ||
456 | 241 | >>> cjwatson = getUtility(IPersonSet).getByName('kamion') | ||
457 | 242 | >>> ubuntu_db = getUtility(IDistributionSet).getByName('ubuntu') | ||
458 | 243 | >>> cjwatson.inTeam(ubuntu_db.main_archive.owner) | ||
459 | 244 | True | ||
460 | 245 | |||
461 | 246 | >>> logout() | ||
462 | 247 | |||
463 | 248 | >>> cjwatson_webservice = webservice_for_person( | ||
464 | 249 | ... cjwatson, permission=OAuthPermission.WRITE_PUBLIC) | ||
465 | 250 | |||
466 | 251 | |||
467 | 252 | `newPackageUploader` is a factory function that adds a new permission | ||
468 | 253 | for a person to upload a package. | ||
469 | 236 | 254 | ||
470 | 237 | >>> name12 = webservice.get("/~name12").jsonBody() | 255 | >>> name12 = webservice.get("/~name12").jsonBody() |
472 | 238 | >>> response = webservice.named_post( | 256 | >>> response = cjwatson_webservice.named_post( |
473 | 239 | ... ubuntu['main_archive_link'], 'newPackageUploader', {}, | 257 | ... ubuntu['main_archive_link'], 'newPackageUploader', {}, |
474 | 240 | ... person=name12['self_link'], | 258 | ... person=name12['self_link'], |
475 | 241 | ... source_package_name='mozilla-firefox') | 259 | ... source_package_name='mozilla-firefox') |
476 | @@ -243,7 +261,7 @@ | |||
477 | 243 | HTTP/1.1 201 Created | 261 | HTTP/1.1 201 Created |
478 | 244 | ... | 262 | ... |
479 | 245 | 263 | ||
481 | 246 | >>> new_permission = webservice.get( | 264 | >>> new_permission = user_webservice.get( |
482 | 247 | ... response.getHeader('Location')).jsonBody() | 265 | ... response.getHeader('Location')).jsonBody() |
483 | 248 | >>> print new_permission['self_link'] | 266 | >>> print new_permission['self_link'] |
484 | 249 | http://.../ubuntu/+archive/primary/+upload/name12?type=packagename&item=mozilla-firefox | 267 | http://.../ubuntu/+archive/primary/+upload/name12?type=packagename&item=mozilla-firefox |
485 | @@ -254,7 +272,7 @@ | |||
486 | 254 | 272 | ||
487 | 255 | deletePackageUploader() removes that permission: | 273 | deletePackageUploader() removes that permission: |
488 | 256 | 274 | ||
490 | 257 | >>> print webservice.named_post( | 275 | >>> print cjwatson_webservice.named_post( |
491 | 258 | ... ubuntu['main_archive_link'], 'deletePackageUploader', {}, | 276 | ... ubuntu['main_archive_link'], 'deletePackageUploader', {}, |
492 | 259 | ... person=name12['self_link'], | 277 | ... person=name12['self_link'], |
493 | 260 | ... source_package_name='mozilla-firefox') | 278 | ... source_package_name='mozilla-firefox') |
494 | @@ -270,7 +288,7 @@ | |||
495 | 270 | upload to a particular component: | 288 | upload to a particular component: |
496 | 271 | 289 | ||
497 | 272 | >>> def show_component_permissions(component=None): | 290 | >>> def show_component_permissions(component=None): |
499 | 273 | ... permissions = webservice.named_get( | 291 | ... permissions = user_webservice.named_get( |
500 | 274 | ... ubuntu['main_archive_link'], 'getUploadersForComponent', | 292 | ... ubuntu['main_archive_link'], 'getUploadersForComponent', |
501 | 275 | ... component_name=component).jsonBody() | 293 | ... component_name=component).jsonBody() |
502 | 276 | ... show_permission_entries(permissions) | 294 | ... show_permission_entries(permissions) |
503 | @@ -280,7 +298,7 @@ | |||
504 | 280 | 298 | ||
505 | 281 | Passing a bad component name results in an error: | 299 | Passing a bad component name results in an error: |
506 | 282 | 300 | ||
508 | 283 | >>> print webservice.named_get( | 301 | >>> print cjwatson_webservice.named_get( |
509 | 284 | ... ubuntu['main_archive_link'], 'getUploadersForComponent', | 302 | ... ubuntu['main_archive_link'], 'getUploadersForComponent', |
510 | 285 | ... component_name="badcomponent") | 303 | ... component_name="badcomponent") |
511 | 286 | HTTP/1.1 400 Bad Request | 304 | HTTP/1.1 400 Bad Request |
512 | @@ -296,7 +314,7 @@ | |||
513 | 296 | newComponentUploader adds a new permission for a person to upload to a | 314 | newComponentUploader adds a new permission for a person to upload to a |
514 | 297 | component. | 315 | component. |
515 | 298 | 316 | ||
517 | 299 | >>> response = webservice.named_post( | 317 | >>> response = cjwatson_webservice.named_post( |
518 | 300 | ... ubuntu['main_archive_link'], 'newComponentUploader', {}, | 318 | ... ubuntu['main_archive_link'], 'newComponentUploader', {}, |
519 | 301 | ... person=name12['self_link'], | 319 | ... person=name12['self_link'], |
520 | 302 | ... component_name='restricted') | 320 | ... component_name='restricted') |
521 | @@ -304,7 +322,7 @@ | |||
522 | 304 | HTTP/1.1 201 Created | 322 | HTTP/1.1 201 Created |
523 | 305 | ... | 323 | ... |
524 | 306 | 324 | ||
526 | 307 | >>> new_permission = webservice.get( | 325 | >>> new_permission = user_webservice.get( |
527 | 308 | ... response.getHeader('Location')).jsonBody() | 326 | ... response.getHeader('Location')).jsonBody() |
528 | 309 | >>> print new_permission['self_link'] | 327 | >>> print new_permission['self_link'] |
529 | 310 | http://.../ubuntu/+archive/primary/+upload/name12?type=component&item=restricted | 328 | http://.../ubuntu/+archive/primary/+upload/name12?type=component&item=restricted |
530 | @@ -315,10 +333,52 @@ | |||
531 | 315 | Archive Upload Rights ...~ubuntu-team restricted None | 333 | Archive Upload Rights ...~ubuntu-team restricted None |
532 | 316 | Archive Upload Rights ...~ubuntu-team universe None | 334 | Archive Upload Rights ...~ubuntu-team universe None |
533 | 317 | 335 | ||
534 | 336 | deleteComponentUploader() removes that permission: | ||
535 | 337 | |||
536 | 338 | >>> print cjwatson_webservice.named_post( | ||
537 | 339 | ... ubuntu['main_archive_link'], 'deleteComponentUploader', {}, | ||
538 | 340 | ... person=name12['self_link'], | ||
539 | 341 | ... component_name='restricted') | ||
540 | 342 | HTTP/1.1 200 Ok | ||
541 | 343 | ... | ||
542 | 344 | |||
543 | 345 | And we can see that it's gone: | ||
544 | 346 | |||
545 | 347 | >>> show_component_permissions() | ||
546 | 348 | Archive Upload Rights ...~ubuntu-team main None | ||
547 | 349 | Archive Upload Rights ...~ubuntu-team restricted None | ||
548 | 350 | Archive Upload Rights ...~ubuntu-team universe None | ||
549 | 351 | |||
550 | 352 | Only the archive owners can add or remove component-uploaders. | ||
551 | 353 | |||
552 | 354 | >>> no_priv = webservice.get("/~no-priv").jsonBody() | ||
553 | 355 | |||
554 | 356 | >>> print user_webservice.named_post( | ||
555 | 357 | ... cprov_archive['self_link'], 'newComponentUploader', {}, | ||
556 | 358 | ... person=no_priv['self_link'], component_name='main') | ||
557 | 359 | HTTP/1.1 401 Unauthorized | ||
558 | 360 | ... | ||
559 | 361 | |||
560 | 362 | >>> cprov_webservice = webservice_for_person( | ||
561 | 363 | ... cprov, permission=OAuthPermission.WRITE_PUBLIC) | ||
562 | 364 | |||
563 | 365 | >>> print cprov_webservice.named_post( | ||
564 | 366 | ... cprov_archive['self_link'], 'newComponentUploader', {}, | ||
565 | 367 | ... person=no_priv['self_link'], component_name='main') | ||
566 | 368 | HTTP/1.1 201 Created | ||
567 | 369 | ... | ||
568 | 370 | |||
569 | 371 | >>> print cprov_webservice.named_post( | ||
570 | 372 | ... cprov_archive['self_link'], 'deleteComponentUploader', {}, | ||
571 | 373 | ... person=no_priv['self_link'], | ||
572 | 374 | ... component_name='main') | ||
573 | 375 | HTTP/1.1 200 Ok | ||
574 | 376 | ... | ||
575 | 377 | |||
576 | 318 | If you add a new permission for someone to upload to a PPA, you must specify | 378 | If you add a new permission for someone to upload to a PPA, you must specify |
577 | 319 | the 'main' component, or an error is returned: | 379 | the 'main' component, or an error is returned: |
578 | 320 | 380 | ||
580 | 321 | >>> response = webservice.named_post( | 381 | >>> response = cprov_webservice.named_post( |
581 | 322 | ... cprov_archive['self_link'], 'newComponentUploader', {}, | 382 | ... cprov_archive['self_link'], 'newComponentUploader', {}, |
582 | 323 | ... person=name12['self_link'], component_name='restricted') | 383 | ... person=name12['self_link'], component_name='restricted') |
583 | 324 | >>> print response | 384 | >>> print response |
584 | @@ -327,29 +387,6 @@ | |||
585 | 327 | InvalidComponent: Component for PPAs should be 'main' | 387 | InvalidComponent: Component for PPAs should be 'main' |
586 | 328 | <BLANKLINE> | 388 | <BLANKLINE> |
587 | 329 | 389 | ||
588 | 330 | >>> response = webservice.named_post( | ||
589 | 331 | ... cprov_archive['self_link'], 'newComponentUploader', {}, | ||
590 | 332 | ... person=name12['self_link'], component_name='main') | ||
591 | 333 | >>> print response | ||
592 | 334 | HTTP/1.1 201 Created | ||
593 | 335 | ... | ||
594 | 336 | |||
595 | 337 | deleteComponentUploader() removes that permission: | ||
596 | 338 | |||
597 | 339 | >>> print webservice.named_post( | ||
598 | 340 | ... ubuntu['main_archive_link'], 'deleteComponentUploader', {}, | ||
599 | 341 | ... person=name12['self_link'], | ||
600 | 342 | ... component_name='restricted') | ||
601 | 343 | HTTP/1.1 200 Ok | ||
602 | 344 | ... | ||
603 | 345 | |||
604 | 346 | And we can see that it's gone: | ||
605 | 347 | |||
606 | 348 | >>> show_component_permissions() | ||
607 | 349 | Archive Upload Rights ...~ubuntu-team main None | ||
608 | 350 | Archive Upload Rights ...~ubuntu-team restricted None | ||
609 | 351 | Archive Upload Rights ...~ubuntu-team universe None | ||
610 | 352 | |||
611 | 353 | getQueueAdminsForComponent returns all the permissions where someone | 390 | getQueueAdminsForComponent returns all the permissions where someone |
612 | 354 | can administer distroseries queues in a particular component. | 391 | can administer distroseries queues in a particular component. |
613 | 355 | 392 | ||
614 | @@ -497,18 +534,9 @@ | |||
615 | 497 | For testing purpose we will create some publications. | 534 | For testing purpose we will create some publications. |
616 | 498 | 535 | ||
617 | 499 | >>> login('foo.bar@canonical.com') | 536 | >>> login('foo.bar@canonical.com') |
628 | 500 | 537 | >>> from lp.soyuz.tests.test_publishing import SoyuzTestPublisher | |
619 | 501 | >>> from lp.registry.interfaces.distribution import ( | ||
620 | 502 | ... IDistributionSet) | ||
621 | 503 | |||
622 | 504 | >>> ubuntu_distro = getUtility(IDistributionSet).getByName('ubuntu') | ||
623 | 505 | |||
624 | 506 | >>> main_archive = ubuntu_distro.main_archive | ||
625 | 507 | |||
626 | 508 | >>> from lp.soyuz.tests.test_publishing import ( | ||
627 | 509 | ... SoyuzTestPublisher) | ||
629 | 510 | >>> test_publisher = SoyuzTestPublisher() | 538 | >>> test_publisher = SoyuzTestPublisher() |
631 | 511 | >>> hoary = ubuntu_distro.getSeries('hoary') | 539 | >>> hoary = ubuntu_db.getSeries('hoary') |
632 | 512 | >>> test_publisher.addFakeChroots(hoary) | 540 | >>> test_publisher.addFakeChroots(hoary) |
633 | 513 | >>> ignore = test_publisher.setUpDefaultDistroSeries(hoary) | 541 | >>> ignore = test_publisher.setUpDefaultDistroSeries(hoary) |
634 | 514 | 542 | ||
635 | @@ -516,27 +544,22 @@ | |||
636 | 516 | ubuntu primary archive. | 544 | ubuntu primary archive. |
637 | 517 | 545 | ||
638 | 518 | >>> ignore = test_publisher.getPubSource( | 546 | >>> ignore = test_publisher.getPubSource( |
646 | 519 | ... sourcename="package1", version="1.0", archive=main_archive) | 547 | ... sourcename="package1", version="1.0", |
647 | 520 | 548 | ... archive=ubuntu_db.main_archive) | |
648 | 521 | >>> ignore = test_publisher.getPubSource( | 549 | |
649 | 522 | ... sourcename="package1", version="1.1", archive=main_archive) | 550 | >>> ignore = test_publisher.getPubSource( |
650 | 523 | 551 | ... sourcename="package1", version="1.1", | |
651 | 524 | >>> ignore = test_publisher.getPubSource( | 552 | ... archive=ubuntu_db.main_archive) |
652 | 525 | ... sourcename="package2", version="1.0", archive=main_archive) | 553 | |
653 | 554 | >>> ignore = test_publisher.getPubSource( | ||
654 | 555 | ... sourcename="package2", version="1.0", | ||
655 | 556 | ... archive=ubuntu_db.main_archive) | ||
656 | 526 | 557 | ||
657 | 527 | A test publication in Celso's PPA. | 558 | A test publication in Celso's PPA. |
658 | 528 | 559 | ||
659 | 529 | >>> cprov = getUtility(IPersonSet).getByName('cprov') | ||
660 | 530 | |||
661 | 531 | >>> ignore = test_publisher.getPubSource( | 560 | >>> ignore = test_publisher.getPubSource( |
662 | 532 | ... sourcename="package3", version="1.0", archive=cprov.archive) | 561 | ... sourcename="package3", version="1.0", archive=cprov.archive) |
663 | 533 | 562 | ||
664 | 534 | Colin is a valid member of the team who owns the ubuntu primary archive. | ||
665 | 535 | |||
666 | 536 | >>> cjwatson = getUtility(IPersonSet).getByName('kamion') | ||
667 | 537 | >>> cjwatson.inTeam(main_archive.owner) | ||
668 | 538 | True | ||
669 | 539 | |||
670 | 540 | Setup done, let's log out and continue with the tests. | 563 | Setup done, let's log out and continue with the tests. |
671 | 541 | 564 | ||
672 | 542 | >>> logout() | 565 | >>> logout() |
673 | @@ -557,13 +580,7 @@ | |||
674 | 557 | When accessed via Colin's key that can perform writes, the API will | 580 | When accessed via Colin's key that can perform writes, the API will |
675 | 558 | respond positively. | 581 | respond positively. |
676 | 559 | 582 | ||
684 | 560 | >>> from canonical.launchpad.testing.pages import webservice_for_person | 583 | >>> print cjwatson_webservice.named_post( |
678 | 561 | >>> from canonical.launchpad.webapp.interfaces import OAuthPermission | ||
679 | 562 | |||
680 | 563 | >>> admin_webservice = webservice_for_person( | ||
681 | 564 | ... cjwatson, permission=OAuthPermission.WRITE_PUBLIC) | ||
682 | 565 | |||
683 | 566 | >>> print admin_webservice.named_post( | ||
685 | 567 | ... ubuntu['main_archive_link'], 'syncSource', {}, | 584 | ... ubuntu['main_archive_link'], 'syncSource', {}, |
686 | 568 | ... source_name='package3', version='1.0', | 585 | ... source_name='package3', version='1.0', |
687 | 569 | ... from_archive=cprov_archive['self_link'], to_pocket='release', | 586 | ... from_archive=cprov_archive['self_link'], to_pocket='release', |
688 | @@ -575,7 +592,7 @@ | |||
689 | 575 | PPA. The 'admin_write' key created for Colin isn't allowed to modify | 592 | PPA. The 'admin_write' key created for Colin isn't allowed to modify |
690 | 576 | Celso's PPA. | 593 | Celso's PPA. |
691 | 577 | 594 | ||
693 | 578 | >>> print admin_webservice.named_post( | 595 | >>> print cjwatson_webservice.named_post( |
694 | 579 | ... cprov_archive['self_link'], 'syncSource', {}, | 596 | ... cprov_archive['self_link'], 'syncSource', {}, |
695 | 580 | ... source_name='package1', version='1.0', | 597 | ... source_name='package1', version='1.0', |
696 | 581 | ... from_archive=ubuntu['main_archive_link'], to_pocket='release', | 598 | ... from_archive=ubuntu['main_archive_link'], to_pocket='release', |
697 | @@ -639,7 +656,8 @@ | |||
698 | 639 | # It can be successfully synchronised to Celso's PPA. | 656 | # It can be successfully synchronised to Celso's PPA. |
699 | 640 | >>> login('foo.bar@canonical.com') | 657 | >>> login('foo.bar@canonical.com') |
700 | 641 | >>> allowed_source = test_publisher.getPubSource( | 658 | >>> allowed_source = test_publisher.getPubSource( |
702 | 642 | ... sourcename="allowed", version="1.0", archive=main_archive) | 659 | ... sourcename="allowed", version="1.0", |
703 | 660 | ... archive=ubuntu_db.main_archive) | ||
704 | 643 | >>> ignore = test_publisher.getPubBinaries(pub_source=allowed_source) | 661 | >>> ignore = test_publisher.getPubBinaries(pub_source=allowed_source) |
705 | 644 | >>> logout() | 662 | >>> logout() |
706 | 645 | 663 | ||
707 | @@ -664,7 +682,7 @@ | |||
708 | 664 | ... source_name="allowed").jsonBody()['total_size'] | 682 | ... source_name="allowed").jsonBody()['total_size'] |
709 | 665 | 0 | 683 | 0 |
710 | 666 | 684 | ||
712 | 667 | Keys with not enough permissions in Celso's PPA context are not | 685 | Keys with insufficient permissions on Celso's PPA context are not |
713 | 668 | allowed to call the method at all. | 686 | allowed to call the method at all. |
714 | 669 | 687 | ||
715 | 670 | >>> print user_webservice.named_post( | 688 | >>> print user_webservice.named_post( |
716 | @@ -675,7 +693,7 @@ | |||
717 | 675 | HTTP/1.1 401 Unauthorized | 693 | HTTP/1.1 401 Unauthorized |
718 | 676 | ... | 694 | ... |
719 | 677 | 695 | ||
721 | 678 | >>> print admin_webservice.named_post( | 696 | >>> print cjwatson_webservice.named_post( |
722 | 679 | ... cprov_archive['self_link'], 'syncSources', {}, | 697 | ... cprov_archive['self_link'], 'syncSources', {}, |
723 | 680 | ... source_names=['package1', 'package2'], | 698 | ... source_names=['package1', 'package2'], |
724 | 681 | ... from_archive=ubuntu['main_archive_link'], to_pocket='release', | 699 | ... from_archive=ubuntu['main_archive_link'], to_pocket='release', |
725 | @@ -899,9 +917,8 @@ | |||
726 | 899 | >>> from lp.soyuz.interfaces.component import IComponentSet | 917 | >>> from lp.soyuz.interfaces.component import IComponentSet |
727 | 900 | >>> from lp.registry.interfaces.pocket import PackagePublishingPocket | 918 | >>> from lp.registry.interfaces.pocket import PackagePublishingPocket |
728 | 901 | >>> login('foo.bar@canonical.com') | 919 | >>> login('foo.bar@canonical.com') |
732 | 902 | >>> cprov_ppa_db = getUtility(IPersonSet).getByName('cprov').archive | 920 | >>> dep = cprov.archive.addArchiveDependency( |
733 | 903 | >>> dep = cprov_ppa_db.addArchiveDependency( | 921 | ... cprov.archive.distribution.main_archive, |
731 | 904 | ... cprov_ppa_db.distribution.main_archive, | ||
734 | 905 | ... PackagePublishingPocket.RELEASE, | 922 | ... PackagePublishingPocket.RELEASE, |
735 | 906 | ... component=getUtility(IComponentSet)['universe']) | 923 | ... component=getUtility(IComponentSet)['universe']) |
736 | 907 | >>> logout() | 924 | >>> logout() |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
= Summary =
This branch fixes https:/ /bugs.edge. launchpad. net/bugs/ 422965.
Now the methods for reading and adjusting archive permissions are restricted to IArchive lp.Edit permission (owners) instead of the *special* IArchivePermiss ionSet (only tech board)
- From now own ubuntu-drivers will be able to allow new uploaders in ubuntu primary archive and PPA owners will be able to do the same for their PPAs.
== Tests ==
./bin/test -vv -t xx-archive.txt
== Demo and Q/A ==
Create a PPA if the user you are logged in doesn't have one, otherwise adjust the parameters of the code snipped below
1. Reading permissions: 'no-priv' ] ame(name= 'ppa')
user.display_ name, ppa.displayname) onsForPerson( person= user):
{{{
user = lp.people[
ppa = lp.me.getPPAByN
print 'Permission for %s in %s' % (
for perm in ppa.getPermissi
print perm.permission
}}}
2. Setting permission: 'no-priv' ] ame(name= 'ppa') newComponentUpl oader(person= user, component_ name='main' )
{{{
user = lp.people[
ppa = lp.me.getPPAByN
ppa.
}}}
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: soyuz/stories/ webservice/ xx-archive. txt soyuz/interface s/archive. py soyuz/configure .zcml
lib/lp/
lib/lp/
lib/lp/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkq ykjkACgkQ7KBXuX yZSjB0xQCgkLYFy zzQ87e23tJDuY7A mJDw 82ziAtkXXhvfszi CW
RlkAn1yplbsf24s
=R4q7
-----END PGP SIGNATURE-----
== Pylint notices ==
lib/lp/ soyuz/interface s/archive. py declarations' (No module named restful) fields' (No module named restful)
39: [F0401] Unable to import 'lazr.enum' (No module named enum)
52: [F0401] Unable to import 'lazr.restful.
58: [F0401] Unable to import 'lazr.restful.