- {sortedCategories.map((category) => {
- const actions = grouped[category];
- const config = CATEGORY_CONFIG[category] || {
- label: category,
- icon: FileText,
- };
- const IconComponent = config.icon;
- return (
-
-
-
-
- {config.label}
-
-
-
- {actions.map((action) => (
-
- {ACTION_LABELS[action] ||
- action.replace(/_/g, " ")}
-
- ))}
-
-
- );
- })}
+ {isFullAccess ? (
+
+
+
+
+
+
Full access
+
All permissions granted across every category
+
-
+ ) : (
+
+
+ {sortedCategories.map((category) => {
+ const actions = grouped[category];
+ const config = CATEGORY_CONFIG[category] || {
+ label: category,
+ icon: FileText,
+ };
+ const IconComponent = config.icon;
+ return (
+
+
+
+
+ {config.label}
+
+
+
+ {actions.map((action) => (
+
+ {ACTION_LABELS[action] ||
+ action.replace(/_/g, " ")}
+
+ ))}
+
+
+ );
+ })}
+
+
+ )}
);
}
+function PermissionsBadge({ permissions }: { permissions: string[] }) {
+ if (permissions.includes("*")) {
+ return (
+
+ Full access
+
+ );
+ }
+ return (
+
+ {permissions.length} permissions
+
+ );
+}
+
// ============ Roles Content ============
function RolesContent({
@@ -506,6 +482,8 @@ function RolesContent({
);
}
+ const editingRole = editingRoleId !== null ? roles.find((r) => r.id === editingRoleId) : null;
+
return (
- {canCreate && !showCreateRole && (
-
-