From 085f8402778d19ece727bbc7eb60f1f6d5f4d6b8 Mon Sep 17 00:00:00 2001 From: harsh mahajan Date: Thu, 20 Aug 2026 22:32:02 +0530 Subject: [PATCH] feat(permissions): add a membership picker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The member role has been in the API and the docs since 1.0, but neither console ever offered it — the only way to set one was to know the syntax and type it into the custom permission box. It keys on a membership ID, which nothing in the console surfaces, so the picker resolves it in two steps: find the user, then choose which of their team memberships to grant. It has to run in that direction — teams.listMemberships indexes only the membership ID and the user ID for search, so picking a team first would leave the member step with a search box that matches nothing. users.list indexes name, email and phone, so the first step behaves like the existing user picker. --- src/lib/components/permissions/actions.svelte | 10 + src/lib/components/permissions/member.svelte | 284 ++++++++++++++++++ .../components/permissions/permissions.svelte | 3 + src/lib/components/permissions/roles.svelte | 3 + 4 files changed, 300 insertions(+) create mode 100644 src/lib/components/permissions/member.svelte diff --git a/src/lib/components/permissions/actions.svelte b/src/lib/components/permissions/actions.svelte index 132ee5b40..d40e6255e 100644 --- a/src/lib/components/permissions/actions.svelte +++ b/src/lib/components/permissions/actions.svelte @@ -2,6 +2,7 @@ import { createEventDispatcher } from 'svelte'; import Label from './label.svelte'; import Custom from './custom.svelte'; + import Member from './member.svelte'; import Team from './team.svelte'; import User from './user.svelte'; import type { Permission } from './permissions.svelte'; @@ -10,6 +11,7 @@ export let showUser: boolean; export let showTeam: boolean; + export let showMember: boolean; export let showLabel: boolean; export let showCustom: boolean; export let groups: Writable>; @@ -55,6 +57,11 @@ showTeam = true; hide(e); }}>Select teams + { + showMember = true; + hide(e); + }}>Select memberships { showLabel = true; @@ -82,6 +89,9 @@ }} {groups} /> {/if} +{#if showMember} + +{/if} {#if showLabel}