[permissions] Adapt FE to non-readable fields (#13440)
Fixes https://github.com/twentyhq/core-team-issues/issues/1261 and https://github.com/twentyhq/core-team-issues/issues/1153 In this PR we - remove fields user do not have read access on from queries (findMany, findDuplicates, returned fields from create or update etc.) - remove fields user do not have read access on from views This is behind a feature flag
This commit is contained in:
+8
@@ -1,5 +1,8 @@
|
||||
import { Field, ObjectType } from '@nestjs/graphql';
|
||||
|
||||
import GraphQLJSON from 'graphql-type-json';
|
||||
import { RestrictedFields } from 'twenty-shared/types';
|
||||
|
||||
@ObjectType('ObjectPermission')
|
||||
export class ObjectPermissionDTO {
|
||||
@Field({ nullable: false })
|
||||
@@ -16,4 +19,9 @@ export class ObjectPermissionDTO {
|
||||
|
||||
@Field({ nullable: true })
|
||||
canDestroyObjectRecords?: boolean;
|
||||
|
||||
@Field(() => GraphQLJSON, {
|
||||
nullable: true,
|
||||
})
|
||||
restrictedFields?: RestrictedFields;
|
||||
}
|
||||
|
||||
+1
@@ -16,6 +16,7 @@ export const fromUserWorkspacePermissionsToUserWorkspacePermissionsDto = ({
|
||||
canUpdateObjectRecords: permissions.canUpdate,
|
||||
canSoftDeleteObjectRecords: permissions.canSoftDelete,
|
||||
canDestroyObjectRecords: permissions.canDestroy,
|
||||
restrictedFields: permissions.restrictedFields,
|
||||
}),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user