Adding validator for uiMetadata.

This commit is contained in:
mike12345567 2024-09-12 15:45:41 +01:00
parent 4952747ae9
commit 4d428f33f6
1 changed files with 5 additions and 0 deletions

View File

@ -208,6 +208,11 @@ export function roleValidator() {
name: Joi.string()
.regex(/^[a-zA-Z0-9_]*$/)
.required(),
uiMetadata: Joi.object({
displayName: OPTIONAL_STRING,
color: OPTIONAL_STRING,
description: OPTIONAL_STRING,
}).optional(),
// this is the base permission ID (for now a built in)
permissionId: Joi.string()
.valid(...Object.values(permissions.BuiltinPermissionID))