Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts">
import { base } from '$app/paths';
import { page } from '$app/stores';
import { CardGrid, Box, Heading, Alert } from '$lib/components';
import { Container } from '$lib/layout';
import { Button } from '$lib/elements/forms';
Expand All @@ -14,6 +16,8 @@
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { collection } from '../store';

const projectId = $page.params.project;

let showDelete = false;
let permissions = $doc?.$permissions;
let arePermsDisabled = true;
Expand Down Expand Up @@ -68,11 +72,10 @@
<CardGrid>
<Heading tag="h6" size="7">Permissions</Heading>
<p>
Assign read or write permissions at the <b> Collection Level</b> or
<b> Document Level</b>. If collection Level permissions are assigned, permissions
Assign read or write permissions at the <b> collection level</b> or
<b> document level</b>. If collection level permissions are assigned, permissions
applied to individual documents are ignored.
</p>

<svelte:fragment slot="aside">
{#if $collection.documentSecurity}
{#if showPermissionAlert}
Expand All @@ -91,10 +94,11 @@
{:else}
<Alert type="info">
<svelte:fragment slot="title">Document security is disabled</svelte:fragment>
<p class="text">
If you want to assign document permissions, navigate to Collection settings
and enable document security. Otherwise, only Collection permissions will be
used.
<p>
Go to <a
href={`${base}/console/project-${projectId}/databases/database-${$doc.$databaseId}/collection-${$doc.$collectionId}/settings`}
class="link">
collection settings</a> to enable document level permissions.
</p>
</Alert>
{/if}
Expand All @@ -110,7 +114,7 @@
</CardGrid>

<CardGrid danger>
<Heading tag="h6" size="7">Delete Document</Heading>
<Heading tag="h6" size="7">Delete document</Heading>
<p>
The document will be permanently deleted, including all the data within it. This action
is irreversible.
Expand All @@ -121,7 +125,7 @@
<h6 class="u-bold u-trim-1">{$doc.$id}</h6>
</svelte:fragment>
<p>
Last Updated: {toLocaleDateTime($doc.$updatedAt)}
Last updated: {toLocaleDateTime($doc.$updatedAt)}
</p>
</Box>
</svelte:fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
{:else}
<Alert type="info">
<svelte:fragment slot="title">Document security is disabled</svelte:fragment>
If you want to assign document permissions, navigate to Collection settings and enable document
If you want to assign document permissions, navigate to collection settings and enable document
security. Otherwise, only Collection permissions will be used.
</Alert>
{/if}
Expand Down