[Apps] App misc - fixes + settings permissions for apps + uploadFile (#17167)
In this PR - handle settings permission check for applications. Until then this was unhandled and applications could not perform actions requiring settings permissions, even if they were granted them - fix ties to attachment, noteTarget etc: When an object had their fields synchronized in the app, the system fields created as a side-effect of the object creation (relations to noteTarget, attachment, taskTarget, favorites, timelineActivities - created with `isCustom: true`, not sure that is correct btw) were then deleted because they are not declared in the app, and identified as deletable because of `isCustom: true`. Updating the logic to exclude system fields from the logic that detects fields to delete. I think this outline the confusion we have around isCustom, isSystem etc. - introduce uploadFile util in generated twenty client as it cannot be handled by the client's query / mutation. I had to use this for my invoicing app
This commit is contained in:
@@ -8,8 +8,8 @@ import {
|
||||
import { GqlExecutionContext } from '@nestjs/graphql';
|
||||
|
||||
import { msg } from '@lingui/core/macro';
|
||||
import { WorkspaceActivationStatus } from 'twenty-shared/workspace';
|
||||
import { type PermissionFlagType } from 'twenty-shared/constants';
|
||||
import { WorkspaceActivationStatus } from 'twenty-shared/workspace';
|
||||
|
||||
import {
|
||||
PermissionsException,
|
||||
@@ -47,6 +47,7 @@ export const SettingsPermissionGuard = (
|
||||
setting: requiredPermission,
|
||||
workspaceId,
|
||||
apiKeyId: ctx.getContext().req.apiKey?.id,
|
||||
applicationId: ctx.getContext().req.application?.id,
|
||||
});
|
||||
|
||||
if (hasPermission === true) {
|
||||
|
||||
Reference in New Issue
Block a user