From b7b74dd9f366d4253db7c6d505724807a9b36ded Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Sat, 10 Sep 2022 13:01:21 +0100 Subject: [PATCH] Use possible_permissions in org view to check if the user has permission to mutate users --- chartered-frontend/src/routes/(authed)/crates/[organisation]/+page.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chartered-frontend/src/routes/(authed)/crates/[organisation]/+page.svelte b/chartered-frontend/src/routes/(authed)/crates/[organisation]/+page.svelte index 2ff9192..9ae9ab6 100644 --- a/chartered-frontend/src/routes/(authed)/crates/[organisation]/+page.svelte +++ a/chartered-frontend/src/routes/(authed)/crates/[organisation]/+page.svelte @@ -57,7 +57,7 @@ * organisation. */ function filterTabsForOrg(org: CrateMembers) { - if (org.members) { + if (org.possible_permissions) { // user has access to the member page but the tab isn't currently being shown, so we should // add it if (!allTabs.some((tab) => tab.id === Tab.MEMBERS)) { @@ -73,7 +73,7 @@ } else { // user doesn't have access to the members page for this org, so remove it from the tab // list, if it exists - allTabs = allTabs.filter((tab) => tab.id !== Tab.CRATES); + allTabs = allTabs.filter((tab) => tab.id !== Tab.MEMBERS); // make sure the current tab is MEMBERS switch them off it, so we don't leave them with // an empty page -- rgit 0.1.3