diff --git a/src/lib/components/workspace/common/AccessControl.svelte b/src/lib/components/workspace/common/AccessControl.svelte index 297da55206..937bc09a7e 100644 --- a/src/lib/components/workspace/common/AccessControl.svelte +++ b/src/lib/components/workspace/common/AccessControl.svelte @@ -35,6 +35,8 @@ export let share = true; export let sharePublic = true; export let shareUsers = true; + export let allowGroups = true; + export let defaultPermission: 'read' | 'write' = 'read'; let groups: any[] = []; const resolvingGroupIds = new Set(); @@ -326,10 +328,16 @@ let next = [...currentGrants()]; for (const groupId of groupIds) { - next = upsertPrincipalGrant('group', groupId, 'read', next); + if (defaultPermission === 'write') { + next = upsertPrincipalGrant('group', groupId, 'read', next); + } + next = upsertPrincipalGrant('group', groupId, defaultPermission, next); } for (const userId of userIds) { - next = upsertPrincipalGrant('user', userId, 'read', next); + if (defaultPermission === 'write') { + next = upsertPrincipalGrant('user', userId, 'read', next); + } + next = upsertPrincipalGrant('user', userId, defaultPermission, next); } commitAccessGrants(next); }; @@ -442,7 +450,13 @@ }); - +
@@ -570,20 +584,26 @@
- + {#if accessRoles.includes('write')} + + {:else} + + {/if} + {#if accessRoles.includes('write')} + + {:else} + + {/if}