diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json index 98122bff..0b7e7a1d 100644 --- a/src/locales/en/translation.json +++ b/src/locales/en/translation.json @@ -1887,6 +1887,7 @@ "failedToRemoveRole": "Failed to remove role", "cannotRemoveSystemRole": "Cannot remove system role", "cannotShareWithSelf": "Cannot share host with yourself", + "noCustomRolesToAssign": "No custom roles available. System roles are auto-assigned.", "auditLogs": "Audit Logs", "viewAuditLogs": "View Audit Logs", "action": "Action", diff --git a/src/locales/zh/translation.json b/src/locales/zh/translation.json index 69b6cb17..506902aa 100644 --- a/src/locales/zh/translation.json +++ b/src/locales/zh/translation.json @@ -1748,6 +1748,7 @@ "failedToRemoveRole": "移除角色失败", "cannotRemoveSystemRole": "无法移除系统角色", "cannotShareWithSelf": "不能与自己共享主机", + "noCustomRolesToAssign": "没有可用的自定义角色。系统角色已自动分配。", "auditLogs": "审计日志", "viewAuditLogs": "查看审计日志", "action": "操作", diff --git a/src/ui/desktop/admin/AdminSettings.tsx b/src/ui/desktop/admin/AdminSettings.tsx index e7f38a78..e15b9e73 100644 --- a/src/ui/desktop/admin/AdminSettings.tsx +++ b/src/ui/desktop/admin/AdminSettings.tsx @@ -1787,6 +1787,15 @@ export function AdminSettings({ {t(role.displayName)} ))} + {availableRoles.filter( + (role) => + !role.isSystem && + !userRoles.some((ur) => ur.roleId === role.id), + ).length === 0 && ( +

+ {t("rbac.noCustomRolesToAssign")} +

+ )}