Feature: Admin UI for role and permission management #52
Labels
No labels
area:api
area:core
area:docs
area:infra
area:ux
dependencies
documentation
duplicate
good first issue
help wanted
invalid
question
rust
status:complete
status:partial
status:planned
type:bug
type:design
type:feature
type:infra
type:refactor
type:research
type:ux
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
icub3d/decentcom#52
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Migrated from GitHub issue icub3d/decentcom#73
Original Author: @icub3d
Original Date: 2026-04-17T01:51:55Z
Feature: Admin UI for role and permission management
Overview
Build a comprehensive admin interface in the client for managing server roles, their permissions, and member role assignments. Admins should be able to create, edit, and delete roles; assign permissions as a visual checklist; and manage which members belong to which roles — all through an intuitive UI.
Background
The server already supports role-based permission management via REST endpoints (
/api/v1/roles,/api/v1/members/:pubkey/roles/:role_id, etc.). Role permissions are stored as a bitmask (14 permission flags defined inserver/src/permissions.rs). The client has basic data structures inclient/src/stores/roles.tsand some partial UI components (RoleList.tsx,RoleEditor.tsx), but the management interface is incomplete and difficult to use. Admins need a visual, intuitive way to:Requirements
@everyoneand@adminrolesDesign
API / Interface Changes
The REST API endpoints already exist:
GET /api/v1/roles— list all rolesPOST /api/v1/roles— create rolePATCH /api/v1/roles/{role_id}— update role (name, color, permissions, position)DELETE /api/v1/roles/{role_id}— delete rolePUT /api/v1/members/{pubkey}/roles/{role_id}— add member to roleDELETE /api/v1/members/{pubkey}/roles/{role_id}— remove member from roleGET /api/v1/members— list members (includes their role assignments)No new API endpoints are needed.
Data Model Changes
No data model changes — the server schema is already set.
Component Changes
Client (
client/):client/src/components/settings/RoleManagementPanel.tsx— new: main admin panel for role management (wraps child components)client/src/components/settings/RoleList.tsx— update: improve existing component to show cards with role infoclient/src/components/settings/RoleEditor.tsx— update: improve to include permission checklist UIclient/src/components/settings/PermissionCheckbox.tsx— new: reusable permission checkbox with label and descriptionclient/src/components/settings/RoleHierarchyManager.tsx— new: UI for reordering roles by positionclient/src/components/members/MemberRoleAssignment.tsx— new: modal/panel for assigning/removing roles from a specific memberclient/src/stores/roles.ts— update: add computed state for role summaries (member count per role, permission descriptions)client/src/api/roles.ts— verify existing API client functions are completeConstants/Utilities:
client/src/constants/permissions.ts— new: export permission names and descriptionsTask List
Phase A — Core permission UI
client/src/constants/permissions.tswith all 14 permission names and descriptionsPermissionCheckbox.tsxcomponent (checkbox + label + description tooltip)RoleEditor.tsxwith permission checklist usingPermissionCheckboxRoleEditor.tsxfor role custom colorPhase B — Role list and hierarchy
RoleList.tsxto show role cards (name, color, member count, summary of permissions)RoleList.tsxRoleHierarchyManager.tsxwith drag-and-drop reordering (or arrow up/down buttons)Phase C — Member role assignment
MemberRoleAssignment.tsxmodal/panel for assigning/removing roles from a memberPhase D — Admin panel integration
RoleManagementPanel.tsxas the top-level admin panelTest List
PERMISSION_INFOconstant covers all 14 permissions with unique names/descriptionsPermissionCheckboxrenders label, description, and is toggleableRoleEditorrenders all 14 permission checkboxes; form values serialize correctlyRoleListdisplays role cards with name, color, member countOpen Questions