feat(users): allow system roles to be renamed but not have permissions changed
- update `updateRole` to allow name changes for system roles while blocking permission updates - remove edit button restriction for system roles in roles page - disable name field only was replaced by disabling permissions checkboxes for system roles in edit modal - update README to reflect new system role update policy
This commit is contained in:
@@ -125,7 +125,6 @@ const RoleEditModal = ({ roleId, isOpen, onClose, onSaved }) => {
|
||||
label="Nom du rôle"
|
||||
value={name}
|
||||
onChange={setName}
|
||||
disabled={isSystem}
|
||||
placeholder="Éditeur, Modérateur..."
|
||||
required
|
||||
/>
|
||||
@@ -162,6 +161,7 @@ const RoleEditModal = ({ roleId, isOpen, onClose, onSaved }) => {
|
||||
onChange={() => togglePerm(perm.key)}
|
||||
label={perm.name}
|
||||
description={perm.description}
|
||||
disabled={isSystem}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@@ -81,15 +81,13 @@ const RolesPageClient = ({ canManage }) => {
|
||||
align: 'right',
|
||||
render: (role) => (
|
||||
<div className="flex items-center justify-end gap-2">
|
||||
{!role.is_system && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() => openEdit(role.id)}
|
||||
icon={PencilEdit01Icon}
|
||||
>
|
||||
Modifier
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
variant="secondary"
|
||||
onClick={() => openEdit(role.id)}
|
||||
icon={PencilEdit01Icon}
|
||||
>
|
||||
Modifier
|
||||
</Button>
|
||||
{!role.is_system && (
|
||||
<Button
|
||||
variant="danger"
|
||||
|
||||
Reference in New Issue
Block a user