Fix permission flag deletion validator (#19636)

As title
This commit is contained in:
martmull
2026-04-13 15:41:28 +02:00
committed by GitHub
parent 1382790c80
commit 227d24512e
@@ -229,13 +229,7 @@ export class FlatPermissionFlagValidatorService {
flatEntityMaps: flatRoleMaps,
});
if (!isDefined(referencedRole)) {
validationResult.errors.push({
code: PermissionsExceptionCode.ROLE_NOT_FOUND,
message: t`Role not found`,
userFriendlyMessage: msg`Role not found`,
});
} else if (!referencedRole.isEditable) {
if (isDefined(referencedRole) && !referencedRole.isEditable) {
validationResult.errors.push({
code: PermissionsExceptionCode.ROLE_NOT_EDITABLE,
message: t`Role is not editable`,