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]
2025-09-28 13:42:10 +00:00
parent 2c80f60f3e
commit 30550d9190
7 changed files with 274 additions and 418 deletions
@@ -21,6 +21,7 @@
export let users = [];
export let group = null;
export let defaultPermissions = {};
export let custom = true;
@@ -230,7 +231,7 @@
{#if selectedTab == 'general'}
<Display bind:name bind:description />
{:else if selectedTab == 'permissions'}
<Permissions bind:permissions />
<Permissions bind:permissions {defaultPermissions} />
{:else if selectedTab == 'users'}
<Users bind:userIds {users} />
{/if}