Fix RBAC role system bugs and improve UX #446

Merged
ZacharyZcR merged 7 commits from fix/rbac-improvements into dev-1.10.0 2025-12-20 02:13:36 +00:00
3 changed files with 11 additions and 0 deletions
Showing only changes of commit dd56108e8a - Show all commits
+1
View File
@@ -1887,6 +1887,7 @@
"failedToRemoveRole": "Failed to remove role", "failedToRemoveRole": "Failed to remove role",
"cannotRemoveSystemRole": "Cannot remove system role", "cannotRemoveSystemRole": "Cannot remove system role",
"cannotShareWithSelf": "Cannot share host with yourself", "cannotShareWithSelf": "Cannot share host with yourself",
"noCustomRolesToAssign": "No custom roles available. System roles are auto-assigned.",
"auditLogs": "Audit Logs", "auditLogs": "Audit Logs",
"viewAuditLogs": "View Audit Logs", "viewAuditLogs": "View Audit Logs",
"action": "Action", "action": "Action",
+1
View File
@@ -1748,6 +1748,7 @@
"failedToRemoveRole": "移除角色失败", "failedToRemoveRole": "移除角色失败",
"cannotRemoveSystemRole": "无法移除系统角色", "cannotRemoveSystemRole": "无法移除系统角色",
"cannotShareWithSelf": "不能与自己共享主机", "cannotShareWithSelf": "不能与自己共享主机",
"noCustomRolesToAssign": "没有可用的自定义角色。系统角色已自动分配。",
"auditLogs": "审计日志", "auditLogs": "审计日志",
"viewAuditLogs": "查看审计日志", "viewAuditLogs": "查看审计日志",
"action": "操作", "action": "操作",
+9
View File
@@ -1787,6 +1787,15 @@ export function AdminSettings({
{t(role.displayName)} {t(role.displayName)}
</Button> </Button>
))} ))}
{availableRoles.filter(
(role) =>
!role.isSystem &&
!userRoles.some((ur) => ur.roleId === role.id),
).length === 0 && (
<p className="text-sm text-muted-foreground">
{t("rbac.noCustomRolesToAssign")}
</p>
)}
</div> </div>
</div> </div>
</div> </div>