From 843914877138f06753e0526f218e9e81843306b9 Mon Sep 17 00:00:00 2001 From: Ark2307 Date: Fri, 3 Jan 2025 15:56:12 +0530 Subject: [PATCH 1/3] Seperated basic rbac in ui --- .../apps/dashboard/pages/settings/users/Users.jsx | 2 +- apps/dashboard/web/polaris_web/web/src/util/func.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/settings/users/Users.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/settings/users/Users.jsx index cf65e32dda..898971160e 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/settings/users/Users.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/settings/users/Users.jsx @@ -25,7 +25,7 @@ const Users = () => { const [usersCollection, setUsersCollection] = useState([]) const [roleHierarchy, setRoleHierarchy] = useState([]) const [allCollections, setAllCollections] = useState([]) - let rbacAccess = func.checkForRbacFeature(); + let rbacAccess = func.checkForRbacFeatureBasic(); const collectionsMap = PersistStore(state => state.collectionsMap) diff --git a/apps/dashboard/web/polaris_web/web/src/util/func.js b/apps/dashboard/web/polaris_web/web/src/util/func.js index 652b884201..fbb703d9bb 100644 --- a/apps/dashboard/web/polaris_web/web/src/util/func.js +++ b/apps/dashboard/web/polaris_web/web/src/util/func.js @@ -1646,6 +1646,16 @@ showConfirmationModal(modalContent, primaryActionContent, primaryAction) { } return false; }, + checkForRbacFeatureBasic(){ + const stiggFeatures = window.STIGG_FEATURE_WISE_ALLOWED + let rbacAccess = false; + if (!stiggFeatures || Object.keys(stiggFeatures).length === 0) { + rbacAccess = true + } else if(stiggFeatures && stiggFeatures['RBAC_BASIC']){ + rbacAccess = stiggFeatures['RBAC_BASIC'].isGranted + } + return rbacAccess; + }, checkForRbacFeature(){ const stiggFeatures = window.STIGG_FEATURE_WISE_ALLOWED let rbacAccess = false; @@ -1657,7 +1667,7 @@ showConfirmationModal(modalContent, primaryActionContent, primaryAction) { return rbacAccess; }, checkUserValidForIntegrations(){ - const rbacAccess = this.checkForRbacFeature(); + const rbacAccess = this.checkForRbacFeatureBasic(); if(!rbacAccess){ return true; } From 3e37032029e22a8fe22f8d9021ba0dab7259fa62 Mon Sep 17 00:00:00 2001 From: Ark2307 Date: Fri, 3 Jan 2025 16:01:19 +0530 Subject: [PATCH 2/3] fixing users page --- .../web/src/apps/dashboard/pages/settings/users/Users.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/settings/users/Users.jsx b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/settings/users/Users.jsx index 898971160e..adc3d73268 100644 --- a/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/settings/users/Users.jsx +++ b/apps/dashboard/web/polaris_web/web/src/apps/dashboard/pages/settings/users/Users.jsx @@ -26,6 +26,7 @@ const Users = () => { const [roleHierarchy, setRoleHierarchy] = useState([]) const [allCollections, setAllCollections] = useState([]) let rbacAccess = func.checkForRbacFeatureBasic(); + let rbacAccessAdvanced = func.checkForRbacFeature() const collectionsMap = PersistStore(state => state.collectionsMap) @@ -319,7 +320,7 @@ const Users = () => { { content: ( - { (role === 'ADMIN' || userRole !== 'ADMIN' || !rbacAccess) ? undefined : + { (role === 'ADMIN' || userRole !== 'ADMIN' || !rbacAccessAdvanced) ? undefined : Date: Fri, 3 Jan 2025 16:37:16 +0530 Subject: [PATCH 3/3] using ubuntu-22.04 for running staging and prod workflows --- .github/workflows/prod.yml | 2 +- .github/workflows/staging.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prod.yml b/.github/workflows/prod.yml index c0aa1ecfe2..3c0ad4600f 100644 --- a/.github/workflows/prod.yml +++ b/.github/workflows/prod.yml @@ -33,7 +33,7 @@ jobs: # This workflow contains a single job called "build" build: # The type of runner that the job will run on - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 02920d5ba9..4917be0eab 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -13,7 +13,7 @@ concurrency: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 outputs: IMAGE_TAG: ${{ steps.docker_tag.outputs.IMAGE_TAG }} steps: