fix(spotlight): show the app search group to app administrators
app.search accepts app-modify-all or board-modify-all, but the spotlight group was only offered to board modifiers, so a user who administers apps could not search them. The two conditions now match.
This commit is contained in:
1 file changed
+6
-5
@@ -17,10 +17,11 @@ export const appIntegrationBoardMode = {
|
|||||||
return groups;
|
return groups;
|
||||||
}
|
}
|
||||||
|
|
||||||
return groups.concat(
|
// Mirrors the gate on app.search: either permission may browse the app catalogue, so an app
|
||||||
session.user.permissions.includes("board-modify-all")
|
// administrator without board access still gets the group instead of a FORBIDDEN response.
|
||||||
? [appsSearchGroup, integrationsSearchGroup]
|
const canSearchApps =
|
||||||
: [integrationsSearchGroup],
|
session.user.permissions.includes("board-modify-all") || session.user.permissions.includes("app-modify-all");
|
||||||
);
|
|
||||||
|
return groups.concat(canSearchApps ? [appsSearchGroup, integrationsSearchGroup] : [integrationsSearchGroup]);
|
||||||
},
|
},
|
||||||
} satisfies SearchMode;
|
} satisfies SearchMode;
|
||||||
Reference in new issue
Block a user