mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-02 04:06:47 +00:00
feat: base-scoped integration access control
This commit is contained in:
@@ -55,6 +55,19 @@ const toBeDeletedIntegration = ref<
|
||||
|
||||
const isLoadingGetLinkedSources = ref(false)
|
||||
|
||||
// Base assignment dialog state
|
||||
const isBaseAssignmentOpen = ref(false)
|
||||
const baseAssignmentIntegration = ref<IntegrationType | null>(null)
|
||||
|
||||
function openBaseAssignment(integration: IntegrationType) {
|
||||
baseAssignmentIntegration.value = integration
|
||||
isBaseAssignmentOpen.value = true
|
||||
}
|
||||
|
||||
function onBaseAssignmentUpdated() {
|
||||
loadIntegrations()
|
||||
}
|
||||
|
||||
const tableWrapper = ref<HTMLDivElement>()
|
||||
|
||||
const orderBy = ref<Partial<Record<SortFields, 'asc' | 'desc' | undefined>>>({})
|
||||
@@ -288,6 +301,16 @@ const columns = [
|
||||
dataIndex: 'source_count',
|
||||
showOrderBy: true,
|
||||
},
|
||||
...(isEeUI
|
||||
? [
|
||||
{
|
||||
key: 'base_access',
|
||||
title: t('labels.baseAccess'),
|
||||
minWidth: 140,
|
||||
width: 160,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
{
|
||||
key: 'action',
|
||||
title: t('labels.actions'),
|
||||
@@ -450,6 +473,29 @@ const customRow = (record: Record<string, any>) => ({
|
||||
</NcTooltip>
|
||||
</template>
|
||||
|
||||
<div v-if="column.key === 'base_access'" class="text-sm">
|
||||
<NcBadge
|
||||
v-if="!integration.is_restricted"
|
||||
size="xs"
|
||||
color="green"
|
||||
:border="false"
|
||||
class="cursor-pointer"
|
||||
@click.stop="openBaseAssignment(integration)"
|
||||
>
|
||||
{{ $t('activity.allBases') }}
|
||||
</NcBadge>
|
||||
<NcBadge
|
||||
v-else
|
||||
size="xs"
|
||||
color="gray"
|
||||
:border="false"
|
||||
class="cursor-pointer"
|
||||
@click.stop="openBaseAssignment(integration)"
|
||||
>
|
||||
{{ $t('labels.restricted') }}
|
||||
</NcBadge>
|
||||
</div>
|
||||
|
||||
<div v-if="column.key === 'action'" @click.stop>
|
||||
<NcDropdown placement="bottomRight">
|
||||
<NcButton size="small" type="secondary">
|
||||
@@ -464,6 +510,10 @@ const customRow = (record: Record<string, any>) => ({
|
||||
<GeneralIcon class="text-current opacity-80" icon="star" />
|
||||
<span>Set as default</span>
|
||||
</NcMenuItem>
|
||||
<NcMenuItem v-if="isEeUI" @click="openBaseAssignment(integration)">
|
||||
<GeneralIcon class="text-current opacity-80" icon="ncDatabase" />
|
||||
<span>{{ $t('labels.manageBaseAccess') }}</span>
|
||||
</NcMenuItem>
|
||||
<NcMenuItem
|
||||
:disabled="!isFeatureEnabled(FEATURE_FLAG.DATA_REFLECTION) && integration.sub_type === SyncDataType.NOCODB"
|
||||
@click="openEditIntegration(integration)"
|
||||
@@ -644,6 +694,14 @@ const customRow = (record: Record<string, any>) => ({
|
||||
</div>
|
||||
</div>
|
||||
</NcModal>
|
||||
|
||||
<!-- Base Assignment Dialog -->
|
||||
<WorkspaceIntegrationsBaseAssignment
|
||||
v-if="isEeUI && baseAssignmentIntegration"
|
||||
v-model:visible="isBaseAssignmentOpen"
|
||||
:integration="baseAssignmentIntegration"
|
||||
@updated="onBaseAssignmentUpdated"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user