Feat: Add warning for conflicting group permissions

This change introduces a visual warning in the group settings page. The warning appears when an admin attempts to disable a permission for a group that is already enabled in the default 'user' group. This is necessary because permissions are additive, and disabling a permission in a specific group will not revoke it if it's enabled in the default group.

To achieve this, the following changes were made:
- A new `PermissionSwitch.svelte` component was created to encapsulate the permission switch and its warning logic, avoiding redundant code.
- The `Groups.svelte` component was updated to correctly fetch the default user group's permissions.
- The `Permissions.svelte` component was refactored to use the new `PermissionSwitch.svelte` component, making the code cleaner and more maintainable.
This commit is contained in:
google-labs-jules[bot] committed 2025-09-28 13:42:10 +00:00
1 parent 2c80f60f3e
commit 30550d9190
7 files changed
+274 -418

No files matched your search

@@ -17,6 +17,7 @@
name: 'Admins',
user_ids: [1, 2, 3]
};
export let defaultPermissions = {};
export let setGroups = () => {};
@@ -59,6 +60,7 @@
edit
{users}
{group}
{defaultPermissions}
onSubmit={updateHandler}
onDelete={deleteHandler}
/>