From 6fca17072ba013a8beec2e669ce09391a90c0b3e Mon Sep 17 00:00:00 2001 From: Tony Mack Date: Sun, 16 Oct 2011 22:17:42 -0400 Subject: [PATCH] filter_creds_by_caller() supports list args --- sfa/trust/auth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sfa/trust/auth.py b/sfa/trust/auth.py index 1b8a1827..41c71cfd 100644 --- a/sfa/trust/auth.py +++ b/sfa/trust/auth.py @@ -303,7 +303,7 @@ class Auth: def get_authority(self, hrn): return get_authority(hrn) - def filter_creds_by_caller(self, creds, caller_hrn): + def filter_creds_by_caller(self, creds, caller_hrn_list): """ Returns a list of creds who's gid caller matches the specified caller hrn @@ -311,10 +311,12 @@ class Auth: if not isinstance(creds, list): creds = [creds] creds = [] + if not isinistance(caller_hrn_list, list): + caller_hrn_list = [caller_hrn_list] for cred in creds: try: tmp_cred = Credential(string=cred) - if tmp_cred.get_gid_caller().get_hrn() == caller_hrn: + if tmp_cred.get_gid_caller().get_hrn() in [caller_hrn_list]: creds.append(cred) except: pass return creds -- 2.47.0