code: func (tam *TokenAuthorizationMiddleware) IsAuthorized(ctx context.Context, method, path string, tenantId int, tokenInfo *TokenInfo) (bool, error) {
  	if tokenInfo == nil {
  		return false, errors.New("Invalid token info")
  	}
  
  	authAdminRoles, err := tam.isAuthorizedAdminActions(ctx, method, path, tokenInfo.AdminActions())
  	if !authAdminRoles || err != nil {
  		return authAdminRoles, err
  	}
  
  	authTenant, err := tam.isAuthorizedTenantId(ctx, tenantId, tokenInfo.TenantId)
  	if !authTenant || err != nil {
  		return authTenant, err
  	}
  
  	authConfig, err := tam.isAuthorizedConfigNamespace(ctx, path, tokenInfo.TenantId)
  	if !authConfig || err != nil {
  		return authConfig, err
  	}
  
  	// If we're here, then we passed all the tests above and we're good to go
  	return true, nil
  }
docs: // Checks whether or not that request is authorized based on the path and method