Browse Source

fix: acl check

pull/8510/head
Pranav C 6 months ago
parent
commit
1bb3c8d9ed
  1. 4
      packages/nc-gui/components/dashboard/settings/DataSources.vue
  2. 9
      packages/nc-gui/components/dashboard/settings/Modal.vue

4
packages/nc-gui/components/dashboard/settings/DataSources.vue

@ -25,6 +25,8 @@ const { isDataSourceLimitReached } = storeToRefs(basesStore)
const baseStore = useBase() const baseStore = useBase()
const { base } = storeToRefs(baseStore) const { base } = storeToRefs(baseStore)
const { isUIAllowed } = useRoles()
const { projectPageTab } = storeToRefs(useConfigStore()) const { projectPageTab } = storeToRefs(useConfigStore())
const { refreshCommandPalette } = useCommandPalette() const { refreshCommandPalette } = useCommandPalette()
@ -270,7 +272,7 @@ const openedTab = ref('erd')
</a-breadcrumb> </a-breadcrumb>
<NcButton <NcButton
v-if="!isDataSourceLimitReached && !activeSource" v-if="!isDataSourceLimitReached && !activeSource && isUIAllowed('sourceCreate')"
size="large" size="large"
class="z-10 !px-2" class="z-10 !px-2"
type="primary" type="primary"

9
packages/nc-gui/components/dashboard/settings/Modal.vue

@ -40,6 +40,8 @@ const vDataState = useVModel(props, 'dataSourcesState', emits)
const baseId = toRef(props, 'baseId') const baseId = toRef(props, 'baseId')
const { isUIAllowed } = useRoles()
provide(ProjectIdInj, baseId) provide(ProjectIdInj, baseId)
const { $e } = useNuxtApp() const { $e } = useNuxtApp()
@ -180,7 +182,11 @@ watch(
<!-- Side tabs --> <!-- Side tabs -->
<a-layout-sider> <a-layout-sider>
<a-menu v-model:selected-keys="selectedTabKeys" class="tabs-menu h-full" :open-keys="[]"> <a-menu v-model:selected-keys="selectedTabKeys" class="tabs-menu h-full" :open-keys="[]">
<a-menu-item v-for="(tab, key) of tabsInfo" :key="key" class="active:(!ring-0) hover:(!bg-primary !bg-opacity-25)"> <template v-for="(tab, key) of tabsInfo" :key="key">
<a-menu-item
v-if="key !== 'dataSources' || isUIAllowed('sourceCreate')"
class="active:(!ring-0) hover:(!bg-primary !bg-opacity-25)"
>
<div class="flex items-center space-x-2" @click="tab.onClick"> <div class="flex items-center space-x-2" @click="tab.onClick">
<component :is="tab.icon" /> <component :is="tab.icon" />
@ -189,6 +195,7 @@ watch(
</div> </div>
</div> </div>
</a-menu-item> </a-menu-item>
</template>
</a-menu> </a-menu>
</a-layout-sider> </a-layout-sider>

Loading…
Cancel
Save