Browse Source

fix: acl check

nc-refactor/ds
Pranav C 1 month ago
parent
commit
1bb3c8d9ed
  1. 4
      packages/nc-gui/components/dashboard/settings/DataSources.vue
  2. 23
      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 { base } = storeToRefs(baseStore)
const { isUIAllowed } = useRoles()
const { projectPageTab } = storeToRefs(useConfigStore())
const { refreshCommandPalette } = useCommandPalette()
@ -270,7 +272,7 @@ const openedTab = ref('erd')
</a-breadcrumb>
<NcButton
v-if="!isDataSourceLimitReached && !activeSource"
v-if="!isDataSourceLimitReached && !activeSource && isUIAllowed('sourceCreate')"
size="large"
class="z-10 !px-2"
type="primary"

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

@ -40,6 +40,8 @@ const vDataState = useVModel(props, 'dataSourcesState', emits)
const baseId = toRef(props, 'baseId')
const { isUIAllowed } = useRoles()
provide(ProjectIdInj, baseId)
const { $e } = useNuxtApp()
@ -180,15 +182,20 @@ watch(
<!-- Side tabs -->
<a-layout-sider>
<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)">
<div class="flex items-center space-x-2" @click="tab.onClick">
<component :is="tab.icon" />
<div class="select-none">
{{ tab.title }}
<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">
<component :is="tab.icon" />
<div class="select-none">
{{ tab.title }}
</div>
</div>
</div>
</a-menu-item>
</a-menu-item>
</template>
</a-menu>
</a-layout-sider>

Loading…
Cancel
Save