Code review comment for lp:~cprov/launchpad/bug-422965-archive-permission-api

Revision history for this message
Celso Providelo (cprov) wrote :

-----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* IArchivePermissionSet (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:
{{{
    user = lp.people['no-priv']
    ppa = lp.me.getPPAByName(name='ppa')
    print 'Permission for %s in %s' % (
        user.display_name, ppa.displayname)
    for perm in ppa.getPermissionsForPerson(person=user):
        print perm.permission
}}}

2. Setting permission:
{{{
    user = lp.people['no-priv']
    ppa = lp.me.getPPAByName(name='ppa')
    ppa.newComponentUploader(person=user, component_name='main')
}}}

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/soyuz/stories/webservice/xx-archive.txt
  lib/lp/soyuz/interfaces/archive.py
  lib/lp/soyuz/configure.zcml
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkqykjkACgkQ7KBXuXyZSjB0xQCgkLYFyzzQ87e23tJDuY7AmJDw
RlkAn1yplbsf24s82ziAtkXXhvfsziCW
=R4q7
-----END PGP SIGNATURE-----

== Pylint notices ==

lib/lp/soyuz/interfaces/archive.py
    39: [F0401] Unable to import 'lazr.enum' (No module named enum)
    52: [F0401] Unable to import 'lazr.restful.declarations' (No module named restful)
    58: [F0401] Unable to import 'lazr.restful.fields' (No module named restful)

« Back to merge proposal