Skip to content

Commit

Permalink
Allow definition of a role group description
Browse files Browse the repository at this point in the history
  • Loading branch information
ba1uev committed May 15, 2024
1 parent 6b3e5d2 commit a39223d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/modules/users/client/components/UserRolesEditorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,12 @@ export const UserRolesEditorModal: React.FC<{
{config.roleGroups.map((g, i) => (
<div key={g.id} className="mb-4">
{!!i && <hr className="mb-4" />}
<div className="mb-2">
<div className="font-semibold">{g.name}</div>
<div className="mb-4">
<div className="font-semibold mb-2">{g.name}</div>
<div className="text-sm">
{g.description && (
<span className="text-text-disabled">{g.description} </span>
)}
{!!g.rules.max && (
<span className="text-text-disabled">
Only {g.rules.max} role{g.rules.max > 1 && 's'} can be
Expand Down
1 change: 1 addition & 0 deletions src/server/app-config/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ export const userRoleGroup = z.object({
})
.default({ max: undefined, unique: false }),
roles: z.array(userRole).min(1),
description: z.string().optional(),
})

export const permissionsConfig = z.object({
Expand Down

0 comments on commit a39223d

Please sign in to comment.