def add_metadata(self, environ, identity):
        #logger = environ.get('repoze.who.logger','')
        try:
            user = self._store[identity.get('repoze.who.userid')]
        except KeyError:
            return

        try:
            vorg = environ["myapp.vo"]
            try:
                ents = user["entitlement"][vorg]
                identity["user"] = {
                            "entitlement": ["%s:%s" % (vorg,e) for e in ents]}
            except KeyError:
                pass
        except __HOLE__:
            res = []
            for vorg, ents in user["entitlement"].items():
                res.extend(["%s:%s" % (vorg, e) for e in ents])
            identity["user"] = res
dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pysaml2-2.4.0/src/s2repoze/plugins/entitlement.py/EntitlementMetadataProvider.add_metadata