[newmaint-site] Allow advocates to edit personal information
Enrico Zini
enrico at enricozini.org
Sat Sep 14 18:15:33 UTC 2013
On Fri, Sep 13, 2013 at 02:21:39AM +0200, Marco Bardelli wrote:
> available at:
> http://anonscm.debian.org/gitweb/?p=users/safanaj-guest/nm2.git;a=commitdiff;h=e34cbe49916d1c475fd5e0bf690d6ae35ec7dd56
>
> I'm a bit confused about 'can_be_edited' properties for Person and
> Process models, why if the am is None we allow editing ??
Now I recall. Without the AM, checks if the record can generally be
edited: it cannot, for example, if there is an account in LDAP, because
LDAP is now the master record for it. With the AM, it checks if it can
be edited by a specific person.
It's a method that I overloaded badly. Luckily it's only used in 3
places in the whole codebase, and always with an 'am' argument passed.
The method also doesn't really specify well what can be edited:
For a Person:
- the bio can always be edited, by FD, the AM, advocates and even
the applicant, and at any time, since we hold the original version.
- cn,mn,sn,email,fpr can be edited by FD, the AM, advocates and even
the applicant only as long as there is no LDAP record, and also
only before the record is in FD or DAM's hands, since by then we're
doing consistency checks of the lot and preparing tickets to be
filed to keyring-maint and DSA for the account to get created.
- fd_comment can only be edited by FD, but at any time
- status can only be edited by DAM (well, currently also FD, but we
trust that they won't edit it)
For a Process:
- progress can be edited by FD, and in some cases the AM. The rest
cannot be changed, or can only be changed via specific views, like
adding advocates.
I've refactored the methods related to permissions into something more
appropriately fine grained. The old can_be_edited methods are removed,
and there are now 'permissions_of' methods in Person and Process to
compute a NMPermissions object which tells all there is to know.
I pushed it to master and deployed it. As a side effect, now for most of
the process, advocates can edit the applicant's information as if they
were the AMs.
Ciao,
Enrico
--
GPG key: 4096R/E7AD5568 2009-05-08 Enrico Zini <enrico at enricozini.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/newmaint-site/attachments/20130914/5b769f18/attachment.sig>
More information about the newmaint-site
mailing list