'Delete all tokens for a given user or user-project combination.
This method adds in the extra logic for handling trust-scoped token
revocations in a single call instead of needing to explicitly handle
trusts in the caller\'s logic.'

def delete_tokens_for_user(self, user_id, project_id=None):

    if (not CONF.token.revoke_by_id):
        return
    self.delete_tokens(user_id, tenant_id=project_id)
    for trust in self.trust_api.list_trusts_for_trustee(user_id):
        self.delete_tokens(user_id, trust_id=trust['id'], tenant_id=project_id)
    for trust in self.trust_api.list_trusts_for_trustor(user_id):
        self.delete_tokens(trust['trustee_user_id'], trust_id=trust['id'], tenant_id=project_id)
