← Back to team overview

launchpad-dev team mailing list archive

Re: [RFC] Bug #347768: Allow anyone with upload rights to write to a package branch.

 

On Thu, Jul 23, 2009 at 11:07:49AM +1000, Jonathan Lange wrote:
> Last night I talked with Bjorn & some Soyuz folks about fixing bug
> #347768: Allow anyone with upload rights to write to a package branch.
> It's a really important bug for the distro that has my full attention.
> My work-in-progress branch is linked to the bug.
> 
> Here's a summary of the discussion. Posted here for your information,
> and so that Julian et al can make sure my understanding is correct.
> 
> To fix this bug I need to determine if a person has upload rights to a
> package, and I need to be able to grant a person upload rights for testing.
> 
> What I've got:
>  * An IPerson
>  * A Pocket
>  * An ISourcePackage, which itself gives me:
>    * An IDistroSeries
>    * An ISourcePackageName
> 
> Bjorn pointed out that Bugs has to make exactly the same check in
> BugNomination.canApprove().

Except that BugNomination.canApprove() doesn't have access to a pocket
(at least not explicitly).


> Julian made it clear to me that these are not enough, that it's impossible to
> get a yes / no answer to the question, "can a person upload to a source
> package?". Being able to upload to a source package is a function of the
> IArchive that one is trying to upload to.
> 
> AIUI, in the abstract sense there's a function::
> 
>   can_upload(IPerson, IArchive, ISourcePackage) => bool

Not that this can_upload() function (at least the last time I looked)
doesn't really give you the answer you're looking for. The above checks
whether the person has been granted upload priviliges to the source
package directly, and not indirectly through a component or a
packageset. Which means that you have to call this function quite a few
times with different arguments to get your answer. This was at least
true for component permissions, but I didn't confirm how it handled
packagesets.


-- 
Björn Tillenius | https://launchpad.net/~bjornt



Follow ups

References