launchpad-reviewers team mailing list archive
-
launchpad-reviewers team
-
Mailing list archive
-
Message #26767
Re: [Merge] ~pappacena/launchpad:ocirecipe-subscription into launchpad:master
Review: Approve
Diff comments:
> diff --git a/lib/lp/registry/services/sharingservice.py b/lib/lp/registry/services/sharingservice.py
> index 727b91c..a0e755b 100644
> --- a/lib/lp/registry/services/sharingservice.py
> +++ b/lib/lp/registry/services/sharingservice.py
> @@ -421,9 +430,19 @@ class SharingService:
> spec for spec in specifications
> if spec.id in visible_private_spec_ids or not spec.private]
>
> - return (
> - visible_bugs, visible_branches, visible_gitrepositories,
> - visible_snaps, visible_specs)
> + # Load the OCI recipes.
> + visible_ocirecipes = []
> + if ocirecipes:
> + visible_ocirecipes = list(getUtility(IOCIRecipeSet).findByIds(
> + ocirecipes_ids, visible_by_user=person))
> +
> + return {
> + "bugs": visible_bugs,
> + "branches": visible_branches,
> + "gitrepositories": visible_gitrepositories,
> + "snaps": visible_snaps,
> + "specifications": visible_specs,
> + "ocirecipes": visible_ocirecipes}
Much better!
>
> def getInvisibleArtifacts(self, person, bugs=None, branches=None,
> gitrepositories=None):
> diff --git a/lib/lp/security.py b/lib/lp/security.py
> index a300279..3ed3429 100644
> --- a/lib/lp/security.py
> +++ b/lib/lp/security.py
> @@ -3467,6 +3468,12 @@ class ViewOCIRecipe(AnonymousAuthorization):
> """Anyone can view an `IOCIRecipe`."""
This docstring could probably do with an update now.
> usedfor = IOCIRecipe
>
> + def checkUnauthenticated(self):
> + return self.obj.visibleByUser(None)
> +
> + def checkAuthenticated(self, user):
> + return self.obj.visibleByUser(user.person)
> +
>
> class EditOCIRecipe(AuthorizationBase):
> permission = 'launchpad.Edit'
--
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/399544
Your team Launchpad code reviewers is subscribed to branch ~pappacena/launchpad:ocirecipe-private-reconcile-pillar.
References