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:
@@ -36,8 +36,13 @@ export type IntegrationPermission = (typeof integrationPermissions)[number];
|
||||
* For example "board-create" is a generated key
|
||||
*/
|
||||
export const groupPermissions = {
|
||||
// Order is the same in the UI, inspired from order in navigation here
|
||||
board: ["create", "view-all", "modify-all", "full-all"],
|
||||
app: ["create", "use-all", "modify-all", "full-all"],
|
||||
integration: ["create", "use-all", "interact-all", "full-all"],
|
||||
"search-engine": ["create", "modify-all", "full-all"],
|
||||
media: ["upload", "view-all", "full-all"],
|
||||
other: ["view-logs"],
|
||||
admin: true,
|
||||
} as const;
|
||||
|
||||
@@ -49,9 +54,21 @@ export const groupPermissions = {
|
||||
const groupPermissionParents = {
|
||||
"board-modify-all": ["board-view-all"],
|
||||
"board-full-all": ["board-modify-all", "board-create"],
|
||||
"app-modify-all": ["app-create"],
|
||||
"app-full-all": ["app-modify-all", "app-use-all"],
|
||||
"integration-interact-all": ["integration-use-all"],
|
||||
"integration-full-all": ["integration-interact-all", "integration-create"],
|
||||
admin: ["board-full-all", "integration-full-all"],
|
||||
"search-engine-modify-all": ["search-engine-create"],
|
||||
"search-engine-full-all": ["search-engine-modify-all"],
|
||||
"media-full-all": ["media-upload", "media-view-all"],
|
||||
admin: [
|
||||
"board-full-all",
|
||||
"app-full-all",
|
||||
"integration-full-all",
|
||||
"search-engine-full-all",
|
||||
"media-full-all",
|
||||
"other-view-logs",
|
||||
],
|
||||
} satisfies Partial<Record<GroupPermissionKey, GroupPermissionKey[]>>;
|
||||
|
||||
export const getPermissionsWithParents = (permissions: GroupPermissionKey[]): GroupPermissionKey[] => {
|
||||
|
||||
Reference in New Issue
Block a user