Allow editing non scim groups

This commit is contained in:
Adria Navarro 2024-02-23 17:08:54 +01:00
parent 39086fcd99
commit 7891e99cf7
2 changed files with 5 additions and 10 deletions

View File

@ -47,9 +47,8 @@
let loaded = false
let editModal, deleteModal
$: scimEnabled = $features.isScimEnabled
$: readonly = !sdk.users.isAdmin($auth.user) || scimEnabled
$: group = $groups.find(x => x._id === groupId)
$: readonly = !sdk.users.isAdmin($auth.user) || group?.scimInfo?.isSync
$: groupApps = $apps
.filter(app =>
groups.actions
@ -135,7 +134,7 @@
</div>
<Layout noPadding gap="S">
<GroupUsers {groupId} {group} />
<GroupUsers {groupId} {readonly} />
</Layout>
<Layout noPadding gap="S">

View File

@ -5,14 +5,13 @@
import { fetchData } from "@budibase/frontend-core"
import { goto } from "@roxi/routify"
import { API } from "api"
import { auth, features, groups } from "stores/portal"
import { groups } from "stores/portal"
import { setContext } from "svelte"
import ScimBanner from "../../_components/SCIMBanner.svelte"
import RemoveUserTableRenderer from "../_components/RemoveUserTableRenderer.svelte"
import { sdk } from "@budibase/shared-core"
export let groupId
export let group
export let readonly
let emailSearch
let fetchGroupUsers
@ -50,9 +49,6 @@
},
]
$: scimEnabled = $features.isScimEnabled && group.scimInfo?.isSync
$: readonly = !sdk.users.isAdmin($auth.user) || scimEnabled
const removeUser = async id => {
await groups.actions.removeUser(groupId, id)
fetchGroupUsers.refresh()
@ -64,7 +60,7 @@
</script>
<div class="header">
{#if !scimEnabled}
{#if !readonly}
<EditUserPicker {groupId} onUsersUpdated={fetchGroupUsers.getInitialData} />
{:else}
<ScimBanner />