From 53e3f6d91de6a5a3133a7a0802c63d327181ffcc Mon Sep 17 00:00:00 2001 From: Nathan Seal Date: Tue, 16 Apr 2024 12:50:31 +1000 Subject: [PATCH] Fix opening non default workspace in webapp The problem was that opening the webapp to a workspace id that was not the default worksapce id was failing with the `Invalid RBAC query` error. It seems like it was introduced in this change: https://github.com/airbytehq/airbyte-platform/commit/61079f598c249eb098147a1f5fba096650683a05#diff-aa38ef9df589b86ae09c4ac9c1653be68a79ed26c07dcb0a75d641de00c99b03R22-R26 Simply reverting the extra check that was added seems to fix the issue. --- airbyte-webapp/src/core/utils/rbac/rbac.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/airbyte-webapp/src/core/utils/rbac/rbac.ts b/airbyte-webapp/src/core/utils/rbac/rbac.ts index af91c99b363..c8700f9b2d5 100644 --- a/airbyte-webapp/src/core/utils/rbac/rbac.ts +++ b/airbyte-webapp/src/core/utils/rbac/rbac.ts @@ -2,7 +2,6 @@ import { useListPermissions } from "core/api"; import { useCurrentUser } from "core/services/auth"; import { RbacQuery, RbacQueryWithoutResourceId, useRbacPermissionsQuery } from "./rbacPermissionsQuery"; -import { isCloudApp } from "../app"; /** * Takes a list of permissions and a full or partial query, returning a boolean representing if the user has any permissions satisfying the query @@ -19,7 +18,7 @@ export const useRbac = (query: RbacQuery | RbacQueryWithoutResourceId) => { // invariant check if ((!queryUsesResourceId && resourceId) || (queryUsesResourceId && !resourceId)) { // TODO: This is a patch to handle the fact that workspaces on cloud do not have an organization. - if (resourceType === "ORGANIZATION" && isCloudApp()) { + if (resourceType === "ORGANIZATION") { console.debug("Ignore missing organization id in useRbac."); } else { // this will throw if there is a missing workspace id OR a resourceId is passed to an instance query