Restrict workflow object permissions (#14290)

- workflows should not edit system objects or workflow related objects
- system fields should be usable within variables for reading
This commit is contained in:
Thomas Trompette
2025-09-04 10:39:51 +02:00
committed by GitHub
parent 6e570ba6c8
commit d6ba6a66a4
10 changed files with 109 additions and 32 deletions
@@ -61,7 +61,7 @@ describe('shouldGenerateFieldFakeValue', () => {
expect(shouldGenerateFieldFakeValue(field)).toBe(false);
});
it('should return false for system fields (except id)', () => {
it('should return true for system fields', () => {
const field = getMockFieldMetadataEntity({
workspaceId: '20202020-0000-0000-0000-000000000000',
objectMetadataId: '20202020-0000-0000-0000-000000000001',
@@ -77,7 +77,7 @@ describe('shouldGenerateFieldFakeValue', () => {
updatedAt: new Date(),
});
expect(shouldGenerateFieldFakeValue(field)).toBe(false);
expect(shouldGenerateFieldFakeValue(field)).toBe(true);
});
it('should return false for relation fields', () => {
@@ -12,7 +12,7 @@ export const shouldGenerateFieldFakeValue = <T extends FieldMetadataType>(
) => {
return (
field.isActive &&
(!field.isSystem || field.name === 'id' || field.name === 'userEmail') &&
field.name !== 'searchVector' &&
(field.type !== FieldMetadataType.RELATION ||
isManyToOneRelationField(field as unknown as FieldMetadataEntity))
);