diff --git a/frontend/src/lib/components/workspaceSettings/AdvancedS3PermissionModal.svelte b/frontend/src/lib/components/workspaceSettings/AdvancedS3PermissionModal.svelte deleted file mode 100644 index fd32e794a0..0000000000 --- a/frontend/src/lib/components/workspaceSettings/AdvancedS3PermissionModal.svelte +++ /dev/null @@ -1,149 +0,0 @@ - - - !!storage, (v) => !v && (storage = undefined)} - target="#content" - contentClasses="flex flex-col gap-3" - fixedWidth="md" - fixedHeight="xl" -> - {#if !!storage} - {#if !$enterpriseLicense} - - Consider upgrading to Windmill EE to use advanced permission rules to control access to your - object storage at a more granular level. - {/if} - !!storage!.advancedPermissions, - (v) => { - storage!.advancedPermissions = v - ? defaultS3AdvancedPermissions(!!$enterpriseLicense) - : undefined - if (v) storage!.publicResource = false - } - } - options={{ - right: 'Enable advanced permission rules', - rightTooltip: 'Control precisely which paths are allowed to your users.' - }} - disabled={!storage.advancedPermissions && !$enterpriseLicense} - /> - {#if storage.advancedPermissions} - - The following will be interpolated : -
    -
  • {'{username}'} : Nickname of the user doing the request
  • -
  • {'{group}'} : Any group that the user belongs to
  • -
  • {'{folder_read}'} : Any folder that the user has read access to
  • -
  • {'{folder_write}'} : Any folder that the user has write access to
  • -
-
- Note that changes may take up to 1 minute to propagate due to cache invalidation -
-
- {#each storage.advancedPermissions ?? [] as item, idx} -
- - - storage!.advancedPermissions?.splice(idx, 1)} /> -
- {/each} -
- - {/if} - {#if !storage.advancedPermissions} - {#if storage.resourceType == 's3'} -
- - {#if storage.publicResource === true} -
- - - S3 resource public access is ON, which means that the entire content of the S3 bucket - will be accessible to all the users of this workspace regardless of whether they have - access the resource or not. Similarly, certain Windmill SDK endpoints can be used in - scripts to access the resource details, including public and private keys. - - {/if} -
- {:else} -
- - {#if storage.publicResource === true} -
- - object public access is ON, which means that the entire content of the object store - will be accessible to all the users of this workspace regardless of whether they have - access the resource or not. - - {/if} -
- {/if} - {/if} - {/if} -
diff --git a/frontend/src/lib/components/workspaceSettings/StorageSettings.svelte b/frontend/src/lib/components/workspaceSettings/StorageSettings.svelte index fb95987db6..69514e819c 100644 --- a/frontend/src/lib/components/workspaceSettings/StorageSettings.svelte +++ b/frontend/src/lib/components/workspaceSettings/StorageSettings.svelte @@ -8,19 +8,23 @@ import Tabs from '../common/tabs/Tabs.svelte' import Description from '../Description.svelte' import ResourcePicker from '../ResourcePicker.svelte' + import Toggle from '../Toggle.svelte' import Tooltip from '../Tooltip.svelte' import { convertFrontendToBackendSetting, defaultS3AdvancedPermissions, - type S3ResourceSettings + type S3ResourceSettings, + type S3ResourceSettingsItem } from '$lib/workspace_settings' import { WorkspaceService } from '$lib/gen' import S3FilePicker from '../S3FilePicker.svelte' import Portal from '../Portal.svelte' + import Popover from '../meltComponents/Popover.svelte' + import ClearableInput from '../common/clearableInput/ClearableInput.svelte' + import MultiSelect from '../select/MultiSelect.svelte' import CloseButton from '../common/CloseButton.svelte' import TextInput from '../text_input/TextInput.svelte' import Select from '../select/Select.svelte' - import AdvancedS3PermissionModal from './AdvancedS3PermissionModal.svelte' let { s3ResourceSettings = $bindable(), @@ -41,9 +45,6 @@ sendUserToast(`Large file storage settings changed`) onSave?.() } - let advancedS3PermissionModalOpened: - | NonNullable[number][1] - | undefined = $state() @@ -228,15 +229,128 @@ {/if} {#snippet permissionBtn(storage: NonNullable[number][1])} - + + + + + +
+ {#if !$enterpriseLicense} + + Consider upgrading to Windmill EE to use advanced permission rules to control access to + your object storage at a more granular level. + {/if} + !!storage.advancedPermissions, + (v) => { + storage.advancedPermissions = v + ? defaultS3AdvancedPermissions(!!$enterpriseLicense) + : undefined + if (v) storage.publicResource = false + } + } + options={{ + right: 'Enable advanced permission rules', + rightTooltip: 'Control precisely which paths are allowed to your users.' + }} + disabled={!storage.advancedPermissions && !$enterpriseLicense} + /> + {#if storage.advancedPermissions} + {@render advancedPermissionsEditor(storage.advancedPermissions)} + {/if} + {#if !storage.advancedPermissions} + {#if storage.resourceType == 's3'} +
+ + {#if storage.publicResource === true} +
+ + + S3 resource public access is ON, which means that the entire content of the S3 + bucket will be accessible to all the users of this workspace regardless of whether + they have access the resource or not. Similarly, certain Windmill SDK endpoints + can be used in scripts to access the resource details, including public and + private keys. + + {/if} +
+ {:else} +
+ + {#if storage.publicResource === true} +
+ + object public access is ON, which means that the entire content of the object + store will be accessible to all the users of this workspace regardless of whether + they have access the resource or not. + + {/if} +
+ {/if} + {/if} +
+
+
{/snippet} - +{#snippet advancedPermissionsEditor(rules: S3ResourceSettingsItem['advancedPermissions'])} + + The following will be interpolated : +
    +
  • {'{username}'} : Nickname of the user doing the request
  • +
  • {'{group}'} : Any group that the user belongs to
  • +
  • {'{folder_read}'} : Any folder that the user has read access to
  • +
  • {'{folder_write}'} : Any folder that the user has write access to
  • +
+
+ Note that changes may take up to 1 minute to propagate due to cache invalidation +
+ {#each rules ?? [] as item, idx} +
+ + + rules?.splice(idx, 1)} /> +
+ {/each} + +{/snippet}