From ad4133a77785e21a32ab8d100e2ebebac0d491fe Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Fri, 13 Jan 2023 08:29:18 +0000 Subject: [PATCH] Allow readonly access to users and groups for developer users --- .../pages/builder/portal/account/usage.svelte | 13 ++++-- .../portal/users/groups/[groupId].svelte | 31 ++++++++------ .../RemoveUserTableRenderer.svelte | 5 ++- .../builder/portal/users/groups/index.svelte | 5 ++- .../portal/users/users/[userId].svelte | 41 +++++++++++++------ .../RemoveGroupTableRenderer.svelte | 5 ++- .../builder/portal/users/users/index.svelte | 14 +++++-- 7 files changed, 78 insertions(+), 36 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/account/usage.svelte b/packages/builder/src/pages/builder/portal/account/usage.svelte index f75b6801fc..c541e66fb1 100644 --- a/packages/builder/src/pages/builder/portal/account/usage.svelte +++ b/packages/builder/src/pages/builder/portal/account/usage.svelte @@ -184,10 +184,15 @@ - - To upgrade your plan and usage limits visit your - account. - + {#if $auth?.user?.accountPortalAccess} + + To upgrade your plan and usage limits visit your + account. + + {:else} + Contact your account holder to upgrade your plan. + {/if} + x._id === groupId) @@ -164,24 +165,28 @@
{group?.name} - - - - - editModal.show()}> - Edit - - deleteModal.show()}> - Delete - - + {#if !readonly} + + + + + editModal.show()}> + Edit + + deleteModal.show()}> + Delete + + + {/if}
Users
- +
import { ActionButton } from "@budibase/bbui" import { getContext } from "svelte" + import { auth } from "stores/portal" export let value @@ -12,4 +13,6 @@ } -Remove + + Remove + diff --git a/packages/builder/src/pages/builder/portal/users/groups/index.svelte b/packages/builder/src/pages/builder/portal/users/groups/index.svelte index 25c8702f6b..43561d2d30 100644 --- a/packages/builder/src/pages/builder/portal/users/groups/index.svelte +++ b/packages/builder/src/pages/builder/portal/users/groups/index.svelte @@ -39,6 +39,7 @@ { column: "roles", component: GroupAppsTableRenderer }, ] + $: readonly = !$auth.isAdmin $: schema = { name: { displayName: "Group", width: "2fr", minWidth: "200px" }, users: { sortable: false, width: "1fr" }, @@ -108,7 +109,9 @@ {#if $licensing.groupsEnabled} - + {:else}