{$i18n.t('Visibility')}
{#if accessControl !== null}
{:else}
{/if}
{ if (e.target.value === 'public') { accessControl = null; } else { accessControl = { read: { group_ids: [] } }; } }} >
Private
Public
{#if accessControl !== null} {$i18n.t('Only select users and groups with permission can access')} {:else} {$i18n.t('Accessible to all users')} {/if}
{#if accessControl !== null} {@const accessGroups = groups.filter((group) => accessControl.read.group_ids.includes(group.id) )}
{$i18n.t('Groups')}
{#if accessGroups.length > 0} {#each accessGroups as group}
{group.name}
{ accessControl.read.group_ids = accessControl.read.group_ids.filter( (id) => id !== group.id ); }} >
{/each} {:else}
{$i18n.t('No groups with access, add a group to grant access')}
{/if}
{$i18n.t('Select a group')}
{#each groups.filter((group) => !accessControl.read.group_ids.includes(group.id)) as group}
{group.name}
{/each}
{ if (selectedGroupId !== '') { accessControl.read.group_ids = [ ...accessControl.read.group_ids, selectedGroupId ]; selectedGroupId = ''; } }} >
{/if}