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:
+2
-2
@@ -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', () => {
|
||||
|
||||
+1
-1
@@ -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))
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user