async _accessCheckInternal(userInfo, appID, action, resName, query) {
    let resource, cached;
    if(config.rbacUseRadixTreeRouting ) {
      if (query === undefined) {
        query = {}
      }
      query.method = action
      query.path = resName
      const resourceResult = await resourceCache.getResourceByRadixTree(appID, query)
      resource = resourceResult.resource
      cached = resourceResult.cached
    } else {
      const resourceResult = await resourceCache.getResource(appID, action, resName)
      resource = resourceResult.resource
      cached = resourceResult.cached
    }
    if(resource) {
      resource.toString = function toString() {
        return JSON.stringify(this)
      }
    }

    if (config.rbacUseRadixTreeRouting) {
      this.log4js.info('getResourceByRadixTree({appID: %s, query: %s}) res: %s, cached: %s', appID, query, resource, cached)
    } else {
      this.log4js.info('getResource({appID: %s, action: %s, resName: %s}) res: %s, cached: %s', appID, action, resName, resource, cached)
    }

    const data = {userInfo: util.filterFieldWhite(userInfo, userFields)}
    if (resource) {
      this.ctx.resource = resource;
      const permID = resource.permID;
      if (permID === constant.SystemPerm.ALLOW_ALL) { // allow all user access
        this.log4js.info('resource {appID: %s, action: %s, resName: %s} permission is [%s], allow all user to access!', appID, action, resName, permID)
        this.success(data)
      } else if (permID === constant.SystemPerm.DENY_ALL) { // deny all user access
        this.log4js.info('resource {appID: %s, action: %s, resName: %s} permission is [%s], not allow any user to access!', appID, action, resName, permID)
        const reason = util.format(this.ctx.i18n.__('ERR_RBAC_ACCESS_FAILURE_DENY_ALL'), {resName})
        this.fail(403, reason, data)
      } else if (userInfo.permissions[permID]) { // have permission
        this.log4js.info('user [%s] have permission [%s] to access {appID: %s, action: %s, resName: %s}', userInfo.username, permID, appID, action, resName)
        this.success(data)
      } else { // have no permission
        this.log4js.info('user [%s] have no permission [%s] to access {appID: %s, action: %s, resName: %s}', userInfo.username, permID, appID, action, resName)
        // TODO: get perm name.
        const reason = util.format(this.ctx.i18n.__('ERR_RBAC_ACCESS_FAILURE_NO_PERM'), {resName,permID})
        this.fail(403, reason, data)
      }
      return
    } else {
      this.log4js.info('user [%s] check permission for resource {appID: %s, action: %s, resName: %s} failed, resource not exist!', userInfo.username, appID, action, resName)
      const reason = util.format(this.ctx.i18n.__('ERR_RBAC_ACCESS_FAILURE_RES_NOT_EXIST'), {resName})
      this.fail(403, reason, data)
    }
  }
query contains:
 args: the query string map
 headers: the request headers
 remoteAddr: the request remote address