def is_account_admin(self, req, account):
        req.credentials_valid = False
        if self.is_super_admin(req):
            return True
        admin_detail = self.get_admin_detail(req)
        if admin_detail:
            if self.is_reseller_admin(req, admin_detail=admin_detail):
                return True
            if not self.credentials_match(admin_detail,
                                          req.headers.get('x-auth-admin-key')):
                return False
            req.credentials_valid = True
            return admin_detail and admin_detail['account'] == account and \
                '.admin' in (g['name'] for g in admin_detail['groups'])
        return False
Returns True if the admin specified in the request represents a .admin
dataset/ETHPy150Open openstack/swauth/swauth/middleware.py/Swauth.is_account_admin