open up visibility amob people on a same site
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 6 Sep 2011 15:09:07 +0000 (17:09 +0200)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Tue, 6 Sep 2011 15:09:07 +0000 (17:09 +0200)
pis and techs can see all users on their site, regardless of roles
formerly people with admin role were artificially hidden

PLC/Persons.py

index d5f1533..0faa3f8 100644 (file)
@@ -143,8 +143,8 @@ class Person(Row):
 
         if 'pi' in self['roles']:
             if set(self['site_ids']).intersection(person['site_ids']):
-                # Can update person is neither a PI or ADMIN
-                return (not (('pi' in person['roles']) or ('admin' in person['roles'])))
+                # non-admin users cannot update a person who is neither a PI or ADMIN
+                return (not set(['pi','admin']).intersection(person['roles']))
 
         return False
 
@@ -163,10 +163,10 @@ class Person(Row):
         if self.can_update(person):
             return True
 
-        if 'pi' in self['roles'] or 'tech' in self['roles']:
+        # pis and techs can see all people on their site
+        if set(['pi','tech']).intersection(self['roles']):
             if set(self['site_ids']).intersection(person['site_ids']):
-                # Can view people with equal or higher role IDs
-                return 'admin' not in person['roles']
+                return True
 
         return False