Merge lp:~rharding/launchpad/limit_sharing_infotype_1083761 into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | j.c.sackett on 2012-11-29 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | 16327 |
| Proposed branch: | lp:~rharding/launchpad/limit_sharing_infotype_1083761 |
| Merge into: | lp:launchpad |
| Diff against target: |
174 lines (+96/-21) 3 files modified
lib/lp/registry/model/product.py (+4/-0) lib/lp/registry/services/sharingservice.py (+44/-17) lib/lp/registry/services/tests/test_sharingservice.py (+48/-4) |
| To merge this branch: | bzr merge lp:~rharding/launchpad/limit_sharing_infotype_1083761 |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| j.c.sackett (community) | 2012-11-29 | Approve on 2012-11-29 | |
|
Review via email:
|
|||
Commit Message
Limit the policy options for get(Bug|
Description of the Change
= Summary =
Per the bug, when a project is non-public then the sharing policies should
never show that you can change the sharing policy to something that is public.
== Pre Implementation ==
Talked with Deryck and Aaron to make sure I was understanding the policies. We
decided to add back in the embargoed and proprietary option into the UI even
though it's also part of the API.
See bug #1055617 for the reason it was originally removed, but it's no longer
an issue.
== Implementation Notes ==
To make things cleaner I added the private property that other models already
have. It makes sense to keep the api onto the products now that they have
information type as well.
Since we're allowing the display of the embargoed or proprietary I removed the
old check in the getBranchSharin
The check is pretty simple. If it's a public product and you have a commercial
subscription you can set about any policy you want. However, if it's not
public then the only two policies that apply are proprietary and
embargoed/
proprietary/
There's a new test method for each getXXXSharingPolicy and a tweak to an
existing test that changed/adjusted. Note that we had to specify the
information type because the factory will allow you to set a sharing policy of
proprietary while leaving the information type of the product as public.
This is a weakness of the factory and adding all the sanity checks to the
factory would be a bit crazy, so we just tweak the test itself.
== QA ==
Create a new public product with a proprietary license and you should get a
commercial subscription. From there, the sharing ui should allow you to select
the sharing policies available.
Create a non-public product and you should only be able to change the sharing
policies to proprietary or embargoed/
== Tests ==
lib/lp/

Looks good. Thanks.