From d7a84789f3d8ae8e69fa2c3aeb2a29887cef40b0 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 11 Nov 2022 09:57:54 +0100 Subject: [PATCH 01/10] feat: add privacy agreement to signup --- src/lib/elements/forms/inputChoice.svelte | 25 +++++++++++++++++++++-- src/routes/register/+page.svelte | 20 ++++++++++++++++-- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/src/lib/elements/forms/inputChoice.svelte b/src/lib/elements/forms/inputChoice.svelte index be04a386ab..f3348f148e 100644 --- a/src/lib/elements/forms/inputChoice.svelte +++ b/src/lib/elements/forms/inputChoice.svelte @@ -1,5 +1,5 @@ @@ -18,7 +34,9 @@ {required} type="checkbox" class:switch={type === 'switchbox'} - bind:checked={value} /> + bind:this={element} + bind:checked={value} + on:invalid={handleInvalid} />
{label}
@@ -27,4 +45,7 @@ {/if}
+ {#if error} + {error} + {/if}
diff --git a/src/routes/register/+page.svelte b/src/routes/register/+page.svelte index f58e12427d..403066094d 100644 --- a/src/routes/register/+page.svelte +++ b/src/routes/register/+page.svelte @@ -5,6 +5,7 @@ Button, Form, FormItem, + InputChoice, InputEmail, InputPassword, InputText @@ -16,6 +17,7 @@ import { Dependencies } from '$lib/constants'; let name: string, mail: string, pass: string; + let terms = false; const register = async () => { try { @@ -60,9 +62,23 @@ required={true} showPasswordButton={true} bind:value={pass} /> - + + By registering, you agree that you have read, understand, and acknowledge our + Privacy Policy + and accept our + General Terms of Use + . - + + From 9111fae33163a0d21a8fd502de79590b6220b835 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 11 Nov 2022 10:06:16 +0100 Subject: [PATCH 02/10] feat: add text to permissions --- src/lib/components/permissions/custom.svelte | 5 ++++- src/lib/components/permissions/team.svelte | 15 ++++++++++++++- src/lib/components/permissions/user.svelte | 7 ++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/lib/components/permissions/custom.svelte b/src/lib/components/permissions/custom.svelte index 617a635906..aecd660684 100644 --- a/src/lib/components/permissions/custom.svelte +++ b/src/lib/components/permissions/custom.svelte @@ -27,7 +27,10 @@ Custom permission - +

+ Custom permissions allow you to grant access to specific users or teams using their ID and + role. +

Select teams - +

+ Grant access to any member of a specific team. To grant access to team members with specific + roles, you will need to set a custom permission. +

+ {#if results?.teams?.length}
diff --git a/src/lib/components/permissions/user.svelte b/src/lib/components/permissions/user.svelte index 9b068db512..d5468b47d9 100644 --- a/src/lib/components/permissions/user.svelte +++ b/src/lib/components/permissions/user.svelte @@ -60,7 +60,12 @@ Select users - +

Grant access to any authenticated or anonymous user.

+ {#if results?.users?.length}
From 280df90b229e48da8fc5d569e49beabc9461a497 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 11 Nov 2022 10:40:27 +0100 Subject: [PATCH 03/10] fix: custom now opens the modal --- src/lib/components/permissions/actions.svelte | 9 ++++++++- src/lib/components/permissions/team.svelte | 7 +++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/lib/components/permissions/actions.svelte b/src/lib/components/permissions/actions.svelte index d97edeffd1..e85deb2fd1 100644 --- a/src/lib/components/permissions/actions.svelte +++ b/src/lib/components/permissions/actions.svelte @@ -43,5 +43,12 @@ - + { + showTeam = false; + showCustom = true; + }} + {groups} /> diff --git a/src/lib/components/permissions/team.svelte b/src/lib/components/permissions/team.svelte index 4ab31e3496..d8d636401b 100644 --- a/src/lib/components/permissions/team.svelte +++ b/src/lib/components/permissions/team.svelte @@ -62,11 +62,10 @@ Select teams

Grant access to any member of a specific team. To grant access to team members with specific - roles, you will need to set a custom permission dispatch('custom')}>custom permission.

Date: Fri, 11 Nov 2022 11:21:07 +0100 Subject: [PATCH 04/10] feat: new security for documents --- .../settings/+page.svelte | 114 ++++++++++-------- 1 file changed, 65 insertions(+), 49 deletions(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte index c8abe4744f..6c7bc2aff7 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte @@ -1,5 +1,5 @@ @@ -160,49 +181,18 @@ on:click={updateName}>Update + Update Permissions

- Assign read or write permissions at the Collection Level or - Document Level. If collection Level permissions are assigned, permissions - applied to individual documents are ignored. + Choose who can access your collection and documents. For more information, check out + the Permissions Guide in our documentation.

-
    -
  • - -
  • -
  • - -
  • -
- - {#if collectionDocumentSecurity} - -

- Manage permissions at the Document Level to control access over - every document in your collection. Check out our documentation for more - on - Permissions -

-
- {:else if collectionPermissions !== null} + {#if collectionPermissions} {/if}
@@ -211,6 +201,32 @@
+ + Update Document Security + + + + +

+ When document security is enabled, users will be able to access documents for + which they have been granted either Document or Collection permissions. +

+

+ If document security is disabled, users can access documents only if they have Collection permissions. Document permissions will be ignored. +

+
+ + + +
+ Delete Collection

From c641d6ed7d737df711bbc9115159ce065a277e5f Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 11 Nov 2022 11:47:22 +0100 Subject: [PATCH 05/10] feat: new security / permissions --- .../settings/+page.svelte | 2 +- .../bucket-[bucket]/settings/+page.svelte | 99 +++++++++++-------- 2 files changed, 60 insertions(+), 41 deletions(-) diff --git a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte index 6c7bc2aff7..838e832a3d 100644 --- a/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte +++ b/src/routes/console/project-[project]/databases/database-[database]/collection-[collection]/settings/+page.svelte @@ -184,7 +184,7 @@ Update Permissions -

+

Choose who can access your collection and documents. For more information, check out the - + @@ -251,37 +264,15 @@
Update Permissions -

- Assign read or write permissions at the Bucket Level or - File Level. If Bucket Level permissions are assigned, file permissions - will be ignored. +

+ Choose who can access your buckets and files. For more information, check out + the Permissions Guide in our documentation.

-
    -
  • - -
  • -
  • - -
  • -
- {#if bucketFileSecurity} + {#if bucketPermissions} {/if}
@@ -291,6 +282,34 @@
+
+ + Update File Security + + + + +

+ When file security is enabled, users will be able to access files for which + they have been granted either File or Bucket permissions. +

+

+ If file security is disabled, users can access files only if they have Bucket permissions. File permissions will be ignored.. +

+
+ + + +
+ +
Update Security Settings From e259c67d2c6961aa80937289c4843c8fcef0d975 Mon Sep 17 00:00:00 2001 From: Arman Date: Fri, 11 Nov 2022 12:25:47 +0100 Subject: [PATCH 06/10] feat: add alerts to modals and wizards --- src/lib/components/alert.svelte | 1 + .../wizard/step2.svelte | 30 +++++++++++++++---- .../storage/bucket-[bucket]/create.svelte | 28 +++++++++++++++-- 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/lib/components/alert.svelte b/src/lib/components/alert.svelte index bf06d2c280..32351e47a5 100644 --- a/src/lib/components/alert.svelte +++ b/src/lib/components/alert.svelte @@ -18,6 +18,7 @@
{#if dismissible}