~mars/launchpad/test-ghost-update

« back to all changes in this revision

Viewing changes to lib/canonical/launchpad/security.py

[r=abentley][ui=none][bug=114766] Restrict the ability to nominate
        bugs for a release to bug supervisors, owners or drivers.

Show diffs side-by-side

added added

removed removed

Lines of Context:
913
913
                user.in_admin)
914
914
 
915
915
 
 
916
class NominateBugForProductSeries(AuthorizationBase):
 
917
    """Product's owners and bug supervisors can add bug nominations."""
 
918
 
 
919
    permission = 'launchpad.BugSupervisor'
 
920
    usedfor = IProductSeries
 
921
 
 
922
    def checkAuthenticated(self, user):
 
923
        return (user.inTeam(self.obj.product.bug_supervisor) or
 
924
                user.inTeam(self.obj.product.owner) or
 
925
                user.in_admin)
 
926
 
 
927
 
 
928
class NominateBugForDistroSeries(AuthorizationBase):
 
929
    """Distro's owners and bug supervisors can add bug nominations."""
 
930
 
 
931
    permission = 'launchpad.BugSupervisor'
 
932
    usedfor = IDistroSeries
 
933
 
 
934
    def checkAuthenticated(self, user):
 
935
        return (user.inTeam(self.obj.distribution.bug_supervisor) or
 
936
                user.inTeam(self.obj.distribution.owner) or
 
937
                user.in_admin)
 
938
 
 
939
 
916
940
class AdminDistroSeries(AdminByAdminsTeam):
917
941
    """Soyuz involves huge chunks of data in the archive and librarian,
918
942
    so for the moment we are locking down admin and edit on distributions