Allow group members edits to admins
This commit is contained in:
parent
41b5799564
commit
4b38b5263b
|
@ -39,9 +39,10 @@
|
||||||
name: {
|
name: {
|
||||||
width: "1fr",
|
width: "1fr",
|
||||||
},
|
},
|
||||||
...(readonly
|
...(!isAdmin
|
||||||
? {}
|
? {}
|
||||||
: {
|
: // Add
|
||||||
|
{
|
||||||
_id: {
|
_id: {
|
||||||
displayName: "",
|
displayName: "",
|
||||||
width: "auto",
|
width: "auto",
|
||||||
|
@ -90,7 +91,9 @@
|
||||||
$: internalGroups = $groups?.filter(g => !g?.scimInfo?.isSync)
|
$: internalGroups = $groups?.filter(g => !g?.scimInfo?.isSync)
|
||||||
|
|
||||||
$: isSSO = !!user?.provider
|
$: isSSO = !!user?.provider
|
||||||
$: readonly = !sdk.users.isAdmin($auth.user) || user?.scimInfo?.isSync
|
$: isAdmin = sdk.users.isAdmin($auth.user)
|
||||||
|
$: isScim = user?.scimInfo?.isSync
|
||||||
|
$: readonly = !isAdmin || isScim
|
||||||
$: privileged = sdk.users.isAdminOrGlobalBuilder(user)
|
$: privileged = sdk.users.isAdminOrGlobalBuilder(user)
|
||||||
$: nameLabel = getNameLabel(user)
|
$: nameLabel = getNameLabel(user)
|
||||||
$: filteredGroups = getFilteredGroups(internalGroups, searchTerm)
|
$: filteredGroups = getFilteredGroups(internalGroups, searchTerm)
|
||||||
|
@ -322,23 +325,23 @@
|
||||||
<Layout gap="S" noPadding>
|
<Layout gap="S" noPadding>
|
||||||
<div class="tableTitle">
|
<div class="tableTitle">
|
||||||
<Heading size="S">Groups</Heading>
|
<Heading size="S">Groups</Heading>
|
||||||
{#if internalGroups?.length}
|
{#if internalGroups?.length && isAdmin}
|
||||||
<div bind:this={popoverAnchor}>
|
<div bind:this={popoverAnchor}>
|
||||||
<Button on:click={popover.show()} secondary>Add to group</Button>
|
<Button on:click={popover.show()} secondary>Add to group</Button>
|
||||||
</div>
|
</div>
|
||||||
|
<Popover align="right" bind:this={popover} anchor={popoverAnchor}>
|
||||||
|
<UserGroupPicker
|
||||||
|
labelKey="name"
|
||||||
|
bind:searchTerm
|
||||||
|
list={filteredGroups}
|
||||||
|
selected={user.userGroups}
|
||||||
|
on:select={e => addGroup(e.detail)}
|
||||||
|
on:deselect={e => removeGroup(e.detail)}
|
||||||
|
iconComponent={GroupIcon}
|
||||||
|
extractIconProps={item => ({ group: item, size: "S" })}
|
||||||
|
/>
|
||||||
|
</Popover>
|
||||||
{/if}
|
{/if}
|
||||||
<Popover align="right" bind:this={popover} anchor={popoverAnchor}>
|
|
||||||
<UserGroupPicker
|
|
||||||
labelKey="name"
|
|
||||||
bind:searchTerm
|
|
||||||
list={filteredGroups}
|
|
||||||
selected={user.userGroups}
|
|
||||||
on:select={e => addGroup(e.detail)}
|
|
||||||
on:deselect={e => removeGroup(e.detail)}
|
|
||||||
iconComponent={GroupIcon}
|
|
||||||
extractIconProps={item => ({ group: item, size: "S" })}
|
|
||||||
/>
|
|
||||||
</Popover>
|
|
||||||
</div>
|
</div>
|
||||||
<Table
|
<Table
|
||||||
schema={groupSchema}
|
schema={groupSchema}
|
||||||
|
|
Loading…
Reference in New Issue