diff --git a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte index 42585c471a..130f9b055b 100644 --- a/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte +++ b/packages/builder/src/pages/builder/portal/manage/users/[userId].svelte @@ -10,14 +10,27 @@ Label, Input, Modal, + Table, ModalContent, notifications, } from "@budibase/bbui" import { fetchData } from "helpers" - import { users } from "stores/portal" + import { users, apps } from "stores/portal" + + import UpdateRolesModal from "./_components/UpdateRolesModal.svelte" export let userId let deleteUserModal + let editRolesModal + + const roleSchema = { + name: { displayName: "App" }, + roles: {}, + } + + // Here we need to merge the Apps list and the roles response to get something that makes sense for the table + $: appList = $apps.map(app => ({ ...app, roles: ["READ"] })) + let selectedApp const request = fetchData(`/api/admin/users/${userId}`) @@ -30,6 +43,11 @@ notifications.error("Failed to delete user.") } } + + async function openUpdateRolesModal({ detail }) { + selectedApp = detail + editRolesModal.show() + } @@ -64,6 +82,18 @@ +
+ Configure roles + + +
Delete user @@ -90,6 +120,9 @@ > + + +