def get_authzd_permissions(self, identifier, perm_domain):
related_perms = []<EOL>keys = ['<STR_LIT:*>', perm_domain]<EOL>def query_permissions(self):<EOL><INDENT>msg = ("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>.format(identifier))<EOL>logger.debug(msg)<EOL>permissions = self.account_store.get_authz_permissions(identifier)<EOL>if not permissions:<EOL><INDENT>msg = "<STR_LIT>".format(identifier)<EOL>raise ValueError(msg)<EOL><DEDENT>return permissions<EOL><DEDENT>try:<EOL><INDENT>msg2 = ("<STR_LIT>"<EOL>.format(identifier))<EOL>logger.debug(msg2)<EOL>domain = '<STR_LIT>' + self.name<EOL>related_perms = self.cache_handler.hmget_or_create(domain=domain,<EOL>identifier=identifier,<EOL>keys=keys,<EOL>creator_func=query_permissions,<EOL>creator=self)<EOL><DEDENT>except ValueError:<EOL><INDENT>msg3 = ("<STR_LIT>"<EOL>"<STR_LIT>".format(identifier))<EOL>logger.warning(msg3)<EOL><DEDENT>except AttributeError:<EOL><INDENT>queried_permissions = query_permissions(self)<EOL>related_perms = [queried_permissions.get('<STR_LIT:*>'),<EOL>queried_permissions.get(perm_domain)]<EOL><DEDENT>return related_perms<EOL>
:type identifier:  str
:type domain:  str

:returns: a list of relevant json blobs, each a list of permission dicts