feat: add more group permissions (#1453)
* feat: add more group permissions * feat: restrict access with app permissions * feat: restrict access with search-engine permissions * feat: restrict access with media permissions * refactor: remove permissions for users, groups and invites * test: adjust app router tests with app permissions * fix: integration page accessible without session * fix: search for users, groups and integrations shown to unauthenticated users * chore: address pull request feedback
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
import { useSession } from "@homarr/auth/client";
|
||||
|
||||
import type { SearchGroup } from "../../lib/group";
|
||||
import type { SearchMode } from "../../lib/mode";
|
||||
import { appsSearchGroup } from "./apps-search-group";
|
||||
import { boardsSearchGroup } from "./boards-search-group";
|
||||
@@ -6,5 +9,14 @@ import { integrationsSearchGroup } from "./integrations-search-group";
|
||||
export const appIntegrationBoardMode = {
|
||||
modeKey: "appIntegrationBoard",
|
||||
character: "#",
|
||||
groups: [appsSearchGroup, integrationsSearchGroup, boardsSearchGroup],
|
||||
useGroups() {
|
||||
const { data: session } = useSession();
|
||||
const groups: SearchGroup[] = [boardsSearchGroup];
|
||||
|
||||
if (!session?.user) {
|
||||
return groups;
|
||||
}
|
||||
|
||||
return groups.concat([appsSearchGroup, integrationsSearchGroup]);
|
||||
},
|
||||
} satisfies SearchMode;
|
||||
|
||||
Reference in New Issue
Block a user