X-Git-Url: http://git.onelab.eu/?p=unfold.git;a=blobdiff_plain;f=portal%2Fvalidationview.py;h=ad69a2e5ce33b4e7db3a2c2c82b695e615358d43;hp=de790341327d81bf67eb3c1e91f0111d966fa4f0;hb=a52c3773de8611def256d97dd699ba09d390b8fd;hpb=02c9260f3ec7e6b11f9b7330418f757075d2ed1f diff --git a/portal/validationview.py b/portal/validationview.py index de790341..ad69a2e5 100644 --- a/portal/validationview.py +++ b/portal/validationview.py @@ -141,6 +141,10 @@ class ValidatePendingView(FreeAccessView): print 'credential_authorities =', credential_authorities print 'credential_authorities_expired =', credential_authorities_expired + # Using cache manifold-tables to get the list of authorities faster + all_authorities_query = Query.get('authority').select('name', 'authority_hrn') + all_authorities = execute_query(self.request, all_authorities_query) + # ** Where am I a PI ** # For this we need to ask SFA (of all authorities) = PI function pi_authorities_query = Query.get('user').filter_by('user_hrn', '==', '$user_hrn').select('pi_authorities') @@ -149,6 +153,16 @@ class ValidatePendingView(FreeAccessView): for pa in pi_authorities_tmp: pi_authorities |= set(pa['pi_authorities']) +# include all sub-authorities of the PI +# if PI on ple, include all sub-auths ple.upmc, ple.inria and so on... +# a = set() +# for authority in authorities: +# for my_authority in my_authorities: +# if authority.startswith(my_authority) and authority not in a: +# a.add(authority) + + + print "pi_authorities =", pi_authorities # My authorities + I have a credential