🏡 index : ~doyle/chartered.git

author Jordan Doyle <jordan@doyle.la> 2022-09-10 13:01:21.0 +01:00:00
committer Jordan Doyle <jordan@doyle.la> 2022-09-10 13:04:46.0 +01:00:00
commit
b7b74dd9f366d4253db7c6d505724807a9b36ded [patch]
tree
7d25e92e2fd0085dfffc4d4296c133c14301856f
parent
1f232c331c6730891396fbe10fb101336340f3c6
download
b7b74dd9f366d4253db7c6d505724807a9b36ded.tar.gz

Use possible_permissions in org view to check if the user has permission to mutate users



Diff

 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