mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
auto-remove stale user/team roles
This commit is contained in:
1 parent
4f6919505c
commit
d36135f5b7
2 files changed
+17
-2
No files matched your search
@@ -139,7 +139,7 @@
|
||||
{#each [...$groups] as [role, permission] (role)}
|
||||
<Table.Row.Base {root}>
|
||||
<Table.Cell column="role" {root}>
|
||||
<Row {role} />
|
||||
<Row {role} on:notFound={() => deleteRole(role)} />
|
||||
</Table.Cell>
|
||||
<Table.Cell column="create" {root}>
|
||||
<Selector.Checkbox
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import { type ComponentProps, type Snippet } from 'svelte';
|
||||
import { type ComponentProps, type Snippet, createEventDispatcher, onMount } from 'svelte';
|
||||
import { sdk } from '$lib/stores/sdk';
|
||||
import type { Models } from '@appwrite.io/console';
|
||||
import { AvatarInitials } from '../';
|
||||
@@ -38,6 +38,8 @@
|
||||
|
||||
let { role, placement = 'bottom-start', children }: Props = $props();
|
||||
|
||||
const dispatch = createEventDispatcher<{ notFound: string }>();
|
||||
|
||||
type ParsedPermission = {
|
||||
type: 'user' | 'team' | 'other';
|
||||
id: string;
|
||||
@@ -111,6 +113,19 @@
|
||||
return fetchPromise;
|
||||
}
|
||||
|
||||
async function verifyExistence() {
|
||||
try {
|
||||
const data = await getData(role);
|
||||
if (data?.notFound) {
|
||||
dispatch('notFound', role);
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
verifyExistence();
|
||||
});
|
||||
|
||||
let isMouseOverTooltip = $state(false);
|
||||
function hidePopover(hideTooltip: () => void, timeout = true) {
|
||||
if (!timeout) {
|
||||
|
||||
Reference in new issue
Block a user