Allow configuring access for views
This commit is contained in:
parent
b53f61228c
commit
1ddd0bca21
|
@ -4,6 +4,7 @@
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
import GridCreateEditRowModal from "components/backend/DataTable/modals/grid/GridCreateEditRowModal.svelte"
|
import GridCreateEditRowModal from "components/backend/DataTable/modals/grid/GridCreateEditRowModal.svelte"
|
||||||
import GridFilterButton from "components/backend/DataTable/buttons/grid/GridFilterButton.svelte"
|
import GridFilterButton from "components/backend/DataTable/buttons/grid/GridFilterButton.svelte"
|
||||||
|
import GridManageAccessButton from "components/backend/DataTable/buttons/grid/GridManageAccessButton.svelte";
|
||||||
|
|
||||||
$: id = $viewsV2.selected?.id
|
$: id = $viewsV2.selected?.id
|
||||||
$: datasource = {
|
$: datasource = {
|
||||||
|
@ -31,6 +32,7 @@
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
<svelte:fragment slot="controls">
|
<svelte:fragment slot="controls">
|
||||||
<GridCreateEditRowModal />
|
<GridCreateEditRowModal />
|
||||||
|
<GridManageAccessButton />
|
||||||
</svelte:fragment>
|
</svelte:fragment>
|
||||||
</Grid>
|
</Grid>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,6 +3,15 @@
|
||||||
import { getContext } from "svelte"
|
import { getContext } from "svelte"
|
||||||
|
|
||||||
const { datasource } = getContext("grid")
|
const { datasource } = getContext("grid")
|
||||||
|
|
||||||
|
$: resourceId = getResourceID($datasource)
|
||||||
|
|
||||||
|
const getResourceID = datasource => {
|
||||||
|
if (!datasource) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
return datasource.type === "table" ? datasource.tableId : datasource.id
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ManageAccessButton resourceId={$datasource?.tableId} />
|
<ManageAccessButton {resourceId} />
|
||||||
|
|
Loading…
Reference in New Issue