Working on virtual org support

This commit is contained in:
Roland Hedberg
2011-04-12 20:23:54 +02:00
parent f82a9550d8
commit 384279eede
2 changed files with 12 additions and 3 deletions

View File

@@ -350,6 +350,12 @@ class SPConfig(Config):
else:
return self.metadata.idps()
def vo_conf(self, vo_name):
try:
return self.virtual_organization[vo_name]
except KeyError:
return None
class IdPConfig(Config):
def_context = "idp"

View File

@@ -14,7 +14,7 @@ class VirtualOrg(object):
def _affiliation_members(self):
"""
Get the member of the Virtual Organization from the metadata,
more specifically a AffiliationDescriptor.
more specifically from AffiliationDescriptor.
"""
return self.config.metadata.vo_members(self.vorg_name)
@@ -25,7 +25,7 @@ class VirtualOrg(object):
try:
return self.vorg_conf["member"]
except KeyError:
except (KeyError, TypeError):
return []
def members_to_ask(self, subject_id):
@@ -49,7 +49,10 @@ class VirtualOrg(object):
(ava, _) = self.sp.users.get_identity(subject_id)
ident = self.vorg_conf["common_identifier"]
return ava[ident][0]
try:
return ava[ident][0]
except KeyError:
return None
def do_aggregation(self, subject_id, log=None):
if log: