Skip to content

The open alternative to Salesforce, designed for AI.

Record-level sharing 2/5: share records beyond the recipient's role (#27054)

Félix Malfait7328f08871ee
diff --git a/packages/twenty-agent-skills/references/develop-app/data-model.md b/packages/twenty-agent-skills/references/develop-app/data-model.md
index 0d59a25a6e4..b972528f3fb 100644
--- a/packages/twenty-agent-skills/references/develop-app/data-model.md
+++ b/packages/twenty-agent-skills/references/develop-app/data-model.md
@@ -102,6 +102,7 @@ When adding permissions:
- Grant the smallest useful scope.
- Keep sensitive objects and fields out of broad roles.
- Check whether the app introduces side effects through logic functions before granting write access.
+- For sensitive objects, set `sharingReach: ObjectSharingReach.ROLE_ACCESS` on `defineObject()` (imported from `twenty-sdk/define`) so records can only be shared with people whose role already reaches them. The default, `ObjectSharingReach.WORKSPACE`, lets a record be shared with anyone in the workspace. It only matters while record sharing is enabled, and objects with `APPLICATION` or `SYSTEM` readability are never shared.
## Verification
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
index 903c6478f31..e5e095f6d67 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.graphql
@@ -293,6 +293,7 @@ type Object {
openRecordIn: ObjectOpenRecordIn!
readability: MetadataReadability!
readabilityParentFieldUniversalIdentifiers: [UUID!]
+ sharingReach: ObjectSharingReach!
writability: MetadataWritability!
applicationId: UUID!
createdAt: DateTime!
@@ -334,6 +335,11 @@ enum MetadataReadability {
SYSTEM
}
+enum ObjectSharingReach {
+ ROLE_ACCESS
+ WORKSPACE
+}
+
enum MetadataWritability {
OPEN
APPLICATION
@@ -4909,6 +4915,7 @@ input UpdateObjectPayload {
isSearchable: Boolean
openRecordIn: ObjectOpenRecordIn
readability: MetadataReadability
+ sharingReach: ObjectSharingReach
translations: [MetadataTranslationOverrideInput!]
}
diff --git a/packages/twenty-client-sdk/src/metadata/generated/schema.ts b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
index faf2c8be55f..7f0201e5e4b 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/schema.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/schema.ts
@@ -212,6 +212,7 @@ export interface Object {
openRecordIn: ObjectOpenRecordIn
readability: MetadataReadability
readabilityParentFieldUniversalIdentifiers?: Scalars['UUID'][]
+ sharingReach: ObjectSharingReach
writability: MetadataWritability
applicationId: Scalars['UUID']
createdAt: Scalars['DateTime']
@@ -232,6 +233,8 @@ export type ObjectOpenRecordIn = 'SIDE_PANEL' | 'RECORD_PAGE' | 'USER_CHOICE'
export type MetadataReadability = 'OPEN' | 'PRIVATE' | 'INHERITED' | 'APPLICATION' | 'SYSTEM'
+export type ObjectSharingReach = 'ROLE_ACCESS' | 'WORKSPACE'
+
export type MetadataWritability = 'OPEN' | 'APPLICATION' | 'SYSTEM'
export interface FullName {
@@ -4001,6 +4004,7 @@ export interface ObjectGenqlSelection{
openRecordIn?: boolean | number
readability?: boolean | number
readabilityParentFieldUniversalIdentifiers?: boolean | number
+ sharingReach?: boolean | number
writability?: boolean | number
applicationId?: boolean | number
createdAt?: boolean | number
@@ -7943,7 +7947,7 @@ export interface UpdateOneObjectInput {update: UpdateObjectPayload,
/** The id of the object to update */
id: Scalars['UUID']}
-export interface UpdateObjectPayload {labelSingular?: (Scalars['String'] | null),labelPlural?: (Scalars['String'] | null),nameSingular?: (Scalars['String'] | null),namePlural?: (Scalars['String'] | null),description?: (Scalars['String'] | null),icon?: (Scalars['String'] | null),shortcut?: (Scalars['String'] | null),color?: (Scalars['String'] | null),isActive?: (Scalars['Boolean'] | null),labelIdentifierFieldMetadataId?: (Scalars['UUID'] | null),imageIdentifierFieldMetadataId?: (Scalars['UUID'] | null),isLabelSyncedWithName?: (Scalars['Boolean'] | null),isSearchable?: (Scalars['Boolean'] | null),openRecordIn?: (ObjectOpenRecordIn | null),readability?: (MetadataReadability | null),translations?: (MetadataTranslationOverrideInput[] | null)}
+export interface UpdateObjectPayload {labelSingular?: (Scalars['String'] | null),labelPlural?: (Scalars['String'] | null),nameSingular?: (Scalars['String'] | null),namePlural?: (Scalars['String'] | null),description?: (Scalars['String'] | null),icon?: (Scalars['String'] | null),shortcut?: (Scalars['String'] | null),color?: (Scalars['String'] | null),isActive?: (Scalars['Boolean'] | null),labelIdentifierFieldMetadataId?: (Scalars['UUID'] | null),imageIdentifierFieldMetadataId?: (Scalars['UUID'] | null),isLabelSyncedWithName?: (Scalars['Boolean'] | null),isSearchable?: (Scalars['Boolean'] | null),openRecordIn?: (ObjectOpenRecordIn | null),readability?: (MetadataReadability | null),sharingReach?: (ObjectSharingReach | null),translations?: (MetadataTranslationOverrideInput[] | null)}
export interface MetadataTranslationOverrideInput {locale: Scalars['String'],property: Scalars['String'],value?: (Scalars['String'] | null)}
@@ -10863,6 +10867,11 @@ export const enumMetadataReadability = {
SYSTEM: 'SYSTEM' as const
}
+export const enumObjectSharingReach = {
+ ROLE_ACCESS: 'ROLE_ACCESS' as const,
+ WORKSPACE: 'WORKSPACE' as const
+}
+
export const enumMetadataWritability = {
OPEN: 'OPEN' as const,
APPLICATION: 'APPLICATION' as const,
diff --git a/packages/twenty-client-sdk/src/metadata/generated/types.ts b/packages/twenty-client-sdk/src/metadata/generated/types.ts
index d6000ebd79e..b347406d0b1 100644
--- a/packages/twenty-client-sdk/src/metadata/generated/types.ts
+++ b/packages/twenty-client-sdk/src/metadata/generated/types.ts
@@ -14,100 +14,101 @@ export default {
26,
27,
28,
- 30,
+ 29,
31,
- 38,
+ 32,
39,
40,
41,
- 44,
- 46,
- 54,
- 56,
- 58,
- 60,
- 63,
- 66,
+ 42,
+ 45,
+ 47,
+ 55,
+ 57,
+ 59,
+ 61,
+ 64,
67,
68,
69,
70,
- 72,
+ 71,
73,
74,
- 76,
+ 75,
77,
- 82,
+ 78,
83,
84,
- 86,
- 94,
- 101,
- 104,
- 106,
- 110,
+ 85,
+ 87,
+ 95,
+ 102,
+ 105,
+ 107,
111,
- 114,
+ 112,
115,
- 117,
- 120,
+ 116,
+ 118,
121,
- 133,
- 148,
- 152,
- 156,
+ 122,
+ 134,
+ 149,
+ 153,
157,
- 160,
- 167,
- 170,
+ 158,
+ 161,
+ 168,
171,
- 175,
- 178,
- 180,
- 201,
- 206,
- 213,
+ 172,
+ 176,
+ 179,
+ 181,
+ 202,
+ 207,
214,
- 221,
- 226,
- 229,
- 252,
- 262,
+ 215,
+ 222,
+ 227,
+ 230,
+ 253,
263,
- 265,
- 270,
- 273,
- 282,
- 313,
- 320,
- 328,
+ 264,
+ 266,
+ 271,
+ 274,
+ 283,
+ 314,
+ 321,
329,
330,
- 332,
+ 331,
333,
334,
335,
336,
337,
338,
- 348,
+ 339,
349,
- 352,
- 386,
- 400,
- 402,
+ 350,
+ 353,
+ 387,
+ 401,
403,
404,
405,
- 407,
- 409,
- 416,
- 435,
- 439,
- 450,
- 570,
- 574,
- 604
+ 406,
+ 408,
+ 410,
+ 417,
+ 436,
+ 440,
+ 451,
+ 571,
+ 575,
+ 605
],
"types": {
"BillingProductDTO": {
@@ -121,13 +122,13 @@ export default {
1
],
"metadata": [
- 81
+ 82
],
"on_BillingLicensedProduct": [
- 90
+ 91
],
"on_BillingMeteredProduct": [
- 91
+ 92
],
"__typename": [
1
@@ -154,7 +155,7 @@ export default {
4
],
"role": [
- 50
+ 51
],
"__typename": [
1
@@ -612,9 +613,12 @@ export default {
"readabilityParentFieldUniversalIdentifiers": [
3
],
- "writability": [
+ "sharingReach": [
28
],
+ "writability": [
+ 29
+ ],
"applicationId": [
3
],
@@ -637,39 +641,39 @@ export default {
1
],
"fields": [
- 277,
+ 278,
{
"paging": [
- 29,
+ 30,
"CursorPaging!"
],
"filter": [
- 32,
+ 33,
"FieldFilter!"
]
}
],
"indexMetadatas": [
- 278,
+ 279,
{
"paging": [
- 29,
+ 30,
"CursorPaging!"
],
"filter": [
- 35,
+ 36,
"IndexFilter!"
]
}
],
"fieldsList": [
- 264
+ 265
],
"indexMetadataList": [
- 272
+ 273
],
"searchFieldMetadataList": [
- 280
+ 281
],
"__typename": [
1
@@ -677,19 +681,20 @@ export default {
},
"ObjectOpenRecordIn": {},
"MetadataReadability": {},
+ "ObjectSharingReach": {},
"MetadataWritability": {},
"CursorPaging": {
"before": [
- 31
+ 32
],
"after": [
- 31
+ 32
],
"first": [
- 30
+ 31
],
"last": [
- 30
+ 31
],
"__typename": [
1
@@ -699,28 +704,28 @@ export default {
"ConnectionCursor": {},
"FieldFilter": {
"and": [
- 32
+ 33
],
"or": [
- 32
+ 33
],
"id": [
- 33
+ 34
],
"isActive": [
- 34
+ 35
],
"isSystem": [
- 34
+ 35
],
"isUIEditable": [
- 34
+ 35
],
"isUIReadOnly": [
- 34
+ 35
],
"objectMetadataId": [
- 33
+ 34
],
"__typename": [
1
@@ -786,16 +791,16 @@ export default {
},
"IndexFilter": {
"and": [
- 35
+ 36
],
"or": [
- 35
+ 36
],
"id": [
- 33
+ 34
],
"isCustom": [
- 34
+ 35
],
"__typename": [
1
@@ -817,7 +822,7 @@ export default {
3
],
"name": [
- 36
+ 37
],
"userEmail": [
1
@@ -829,7 +834,7 @@ export default {
1
],
"openRecordIn": [
- 38
+ 39
],
"avatarUrl": [
1
@@ -838,19 +843,19 @@ export default {
1
],
"calendarStartDay": [
- 30
+ 31
],
"timeZone": [
1
],
"dateFormat": [
- 39
+ 40
],
"timeFormat": [
- 40
+ 41
],
"roles": [
- 50
+ 51
],
"userId": [
3
@@ -859,7 +864,7 @@ export default {
3
],
"numberFormat": [
- 41
+ 42
],
"__typename": [
1
@@ -900,7 +905,7 @@ export default {
1
],
"logicalOperator": [
- 44
+ 45
],
"positionInRowLevelPermissionPredicateGroup": [
15
@@ -927,7 +932,7 @@ export default {
1
],
"operand": [
- 46
+ 47
],
"subFieldName": [
1
@@ -975,10 +980,10 @@ export default {
9
],
"rowLevelPermissionPredicates": [
- 45
+ 46
],
"rowLevelPermissionPredicateGroups": [
- 43
+ 44
],
"__typename": [
1
@@ -1044,13 +1049,13 @@ export default {
8
],
"workspaceMembers": [
- 37
+ 38
],
"agents": [
10
],
"apiKeys": [
- 49
+ 50
],
"canUpdateAllSettings": [
8
@@ -1071,19 +1076,19 @@ export default {
8
],
"permissionFlags": [
- 48
+ 49
],
"objectPermissions": [
- 47
+ 48
],
"fieldPermissions": [
- 42
+ 43
],
"rowLevelPermissionPredicates": [
- 45
+ 46
],
"rowLevelPermissionPredicateGroups": [
- 43
+ 44
],
"__typename": [
1
@@ -1142,7 +1147,7 @@ export default {
3
],
"defaultLogicFunctionRole": [
- 50
+ 51
],
"agents": [
10
@@ -1194,7 +1199,7 @@ export default {
3
],
"user": [
- 75
+ 76
],
"userId": [
3
@@ -1212,16 +1217,16 @@ export default {
4
],
"permissionFlags": [
- 54
+ 55
],
"objectPermissions": [
- 47
+ 48
],
"objectsPermissions": [
- 47
+ 48
],
"twoFactorAuthenticationMethodSummary": [
- 52
+ 53
],
"isImpersonating": [
8
@@ -1257,7 +1262,7 @@ export default {
15
],
"aggregateOperation": [
- 56
+ 57
],
"viewId": [
3
@@ -1296,7 +1301,7 @@ export default {
3
],
"logicalOperator": [
- 58
+ 59
],
"positionInViewFilterGroup": [
15
@@ -1329,7 +1334,7 @@ export default {
3
],
"operand": [
- 60
+ 61
],
"value": [
9
@@ -1406,7 +1411,7 @@ export default {
3
],
"direction": [
- 63
+ 64
],
"subFieldName": [
1
@@ -1463,7 +1468,7 @@ export default {
4
],
"viewFields": [
- 55
+ 56
],
"isOverridden": [
8
@@ -1492,10 +1497,10 @@ export default {
3
],
"type": [
- 66
+ 67
],
"key": [
- 67
+ 68
],
"icon": [
1
@@ -1510,10 +1515,10 @@ export default {
8
],
"openRecordIn": [
- 68
+ 69
],
"kanbanAggregateOperation": [
- 56
+ 57
],
"kanbanAggregateOperationFieldMetadataId": [
3
@@ -1525,10 +1530,10 @@ export default {
8
],
"kanbanColumnWidth": [
- 30
+ 31
],
"groupLoadLimit": [
- 30
+ 31
],
"calendarFieldMetadataId": [
3
@@ -1543,7 +1548,7 @@ export default {
1
],
"calendarLayout": [
- 69
+ 70
],
"createdAt": [
4
@@ -1555,25 +1560,25 @@ export default {
4
],
"viewFields": [
- 55
+ 56
],
"viewFilters": [
- 59
+ 60
],
"viewFilterGroups": [
- 57
+ 58
],
"viewSorts": [
- 62
+ 63
],
"viewGroups": [
- 61
+ 62
],
"viewFieldGroups": [
- 64
+ 65
],
"visibility": [
- 70
+ 71
],
"createdByUserWorkspaceId": [
3
@@ -1628,7 +1633,7 @@ export default {
8
],
"workspaceDiscoverability": [
- 72
+ 73
],
"trashRetentionDays": [
15
@@ -1640,25 +1645,25 @@ export default {
15
],
"activationStatus": [
- 73
+ 74
],
"views": [
- 65
+ 66
],
"viewFields": [
- 55
+ 56
],
"viewFilters": [
- 59
+ 60
],
"viewFilterGroups": [
- 57
+ 58
],
"viewGroups": [
- 61
+ 62
],
"viewSorts": [
- 62
+ 63
],
"metadataVersion": [
15
@@ -1706,13 +1711,13 @@ export default {
1
],
"defaultRole": [
- 50
+ 51
],
"aiChatModelTier": [
- 74
+ 75
],
"aiAgentModelTier": [
- 74
+ 75
],
"isAutoModelSelectionEnabled": [
8
@@ -1727,25 +1732,25 @@ export default {
1
],
"workspaceCustomApplication": [
- 51
+ 52
],
"featureFlags": [
- 205
+ 206
],
"billingSubscriptions": [
- 93
+ 94
],
"installedApplications": [
- 51
+ 52
],
"currentBillingSubscription": [
- 93
+ 94
],
"billingCustomer": [
- 95
+ 96
],
"billingEntitlements": [
- 281
+ 282
],
"hasValidSignedEnterpriseKey": [
8
@@ -1754,7 +1759,7 @@ export default {
8
],
"workspaceUrls": [
- 207
+ 208
],
"workspaceCustomApplicationId": [
1
@@ -1804,31 +1809,31 @@ export default {
1
],
"workspaceMember": [
- 37
+ 38
],
"userWorkspaces": [
- 53
+ 54
],
"onboardingStatus": [
- 76
+ 77
],
"previousOnboardingStatus": [
- 76
+ 77
],
"currentWorkspace": [
- 71
+ 72
],
"currentUserWorkspace": [
- 53
+ 54
],
"userVars": [
- 77
+ 78
],
"workspaceMembers": [
- 37
+ 38
],
"deletedWorkspaceMembers": [
- 249
+ 250
],
"hasPassword": [
8
@@ -1840,10 +1845,10 @@ export default {
8
],
"workspaces": [
- 53
+ 54
],
"availableWorkspaces": [
- 248
+ 249
],
"__typename": [
1
@@ -1929,7 +1934,7 @@ export default {
15
],
"items": [
- 79
+ 80
],
"__typename": [
1
@@ -1937,13 +1942,13 @@ export default {
},
"BillingProductMetadata": {
"planKey": [
- 82
+ 83
],
"priceUsageBased": [
- 83
+ 84
],
"productKey": [
- 84
+ 85
],
"isLegacy": [
1
@@ -1957,7 +1962,7 @@ export default {
"BillingProductKey": {},
"BillingPriceLicensed": {
"recurringInterval": [
- 86
+ 87
],
"unitAmount": [
15
@@ -1966,7 +1971,7 @@ export default {
1
],
"priceUsageType": [
- 83
+ 84
],
"creditAmount": [
15
@@ -1995,16 +2000,16 @@ export default {
},
"BillingPriceMetered": {
"tiers": [
- 87
+ 88
],
"recurringInterval": [
- 86
+ 87
],
"stripePriceId": [
1
],
"priceUsageType": [
- 83
+ 84
],
"__typename": [
1
@@ -2021,7 +2026,7 @@ export default {
1
],
"metadata": [
- 81
+ 82
],
"__typename": [
1
@@ -2038,10 +2043,10 @@ export default {
1
],
"metadata": [
- 81
+ 82
],
"prices": [
- 85
+ 86
],
"__typename": [
1
@@ -2058,10 +2063,10 @@ export default {
1
],
"metadata": [
- 81
+ 82
],
"prices": [
- 88
+ 89
],
"__typename": [
1
@@ -2098,13 +2103,13 @@ export default {
3
],
"status": [
- 94
+ 95
],
"interval": [
- 86
+ 87
],
"billingSubscriptionItems": [
- 92
+ 93
],
"currentPeriodEnd": [
4
@@ -2113,7 +2118,7 @@ export default {
9
],
"phases": [
- 80
+ 81
],
"cancelAt": [
4
@@ -2204,19 +2209,19 @@ export default {
1
],
"type": [
- 101
+ 102
],
"objectMetadataId": [
3
],
"gridPosition": [
- 99
+ 100
],
"position": [
- 102
+ 103
],
"configuration": [
- 108
+ 109
],
"conditionalDisplay": [
9
@@ -2246,13 +2251,13 @@ export default {
"WidgetType": {},
"PageLayoutWidgetPosition": {
"on_PageLayoutWidgetGridPosition": [
- 103
+ 104
],
"on_PageLayoutWidgetVerticalListPosition": [
- 105
+ 106
],
"on_PageLayoutWidgetCanvasPosition": [
- 107
+ 108
],
"__typename": [
1
@@ -2260,19 +2265,19 @@ export default {
},
"PageLayoutWidgetGridPosition": {
"layoutMode": [
- 104
+ 105
],
"row": [
- 30
+ 31
],
"column": [
- 30
+ 31
],
"rowSpan": [
- 30
+ 31
],
"columnSpan": [
- 30
+ 31
],
"__typename": [
1
@@ -2281,13 +2286,13 @@ export default {
"PageLayoutTabLayoutMode": {},
"PageLayoutWidgetVerticalListPosition": {
"layoutMode": [
- 104
+ 105
],
"index": [
- 30
+ 31
],
"heightBehavior": [
- 106
+ 107
],
"__typename": [
1
@@ -2296,7 +2301,7 @@ export default {
"PageLayoutWidgetVerticalListHeightBehavior": {},
"PageLayoutWidgetCanvasPosition": {
"layoutMode": [
- 104
+ 105
],
"__typename": [
1
@@ -2304,91 +2309,91 @@ export default {
},
"WidgetConfiguration": {
"on_AggregateChartConfiguration": [
- 109
+ 110
],
"on_StandaloneRichTextConfiguration": [
- 112
- ],
- "on_PieChartConfiguration": [
113
],
+ "on_PieChartConfiguration": [
+ 114
+ ],
"on_LineChartConfiguration": [
- 116
+ 117
],
"on_IframeConfiguration": [
- 118
+ 119
],
"on_BarChartConfiguration": [
- 119
+ 120
],
"on_CalendarConfiguration": [
- 122
+ 123
],
"on_FrontComponentConfiguration": [
- 123
+ 124
],
"on_EmailsConfiguration": [
- 124
+ 125
],
"on_EmailThreadConfiguration": [
- 125
+ 126
],
"on_CallRecordingSummaryConfiguration": [
- 126
+ 127
],
"on_CallRecordingTranscriptConfiguration": [
- 127
+ 128
],
"on_ChatThreadsConfiguration": [
- 128
+ 129
],
"on_ChatConfiguration": [
- 129
+ 130
],
"on_MessageCampaignBodyConfiguration": [
- 130
+ 131
],
"on_MessageCampaignDetailsConfiguration": [
- 131
+ 132
],
"on_FieldConfiguration": [
- 132
+ 133
],
"on_FieldRichTextConfiguration": [
- 134
+ 135
],
"on_FieldsConfiguration": [
- 135
+ 136
],
"on_FormFieldConfiguration": [
- 136
+ 137
],
"on_FilesConfiguration": [
- 137
+ 138
],
"on_NotesConfiguration": [
- 138
+ 139
],
"on_TasksConfiguration": [
- 139
+ 140
],
"on_TimelineConfiguration": [
- 140
+ 141
],
"on_ViewConfiguration": [
- 141
+ 142
],
"on_RecordTableConfiguration": [
- 142
+ 143
],
"on_WorkflowConfiguration": [
- 143
+ 144
],
"on_WorkflowRunConfiguration": [
- 144
+ 145
],
"on_WorkflowVersionConfiguration": [
- 145
+ 146
],
"__typename": [
1
@@ -2396,13 +2401,13 @@ export default {
},
"AggregateChartConfiguration": {
"configurationType": [
- 110
+ 111
],
"aggregateFieldMetadataId": [
3
],
"aggregateOperation": [
- 56
+ 57
],
"label": [
1
@@ -2411,7 +2416,7 @@ export default {
8
],
"numberFormat": [
- 111
+ 112
],
"description": [
1
@@ -2423,7 +2428,7 @@ export default {
1
],
"firstDayOfTheWeek": [
- 30
+ 31
],
"prefix": [
1
@@ -2432,7 +2437,7 @@ export default {
1
],
"ratioAggregateConfig": [
- 97
+ 98
],
"__typename": [
1
@@ -2442,10 +2447,10 @@ export default {
"ChartNumberFormat": {},
"StandaloneRichTextConfiguration": {
"configurationType": [
- 110
+ 111
],
"body": [
- 98
+ 99
],
"__typename": [
1
@@ -2453,13 +2458,13 @@ export default {
},
"PieChartConfiguration": {
"configurationType": [
- 110
+ 111
],
"aggregateFieldMetadataId": [
3
],
"aggregateOperation": [
- 56
+ 57
],
"groupByFieldMetadataId": [
3
@@ -2468,10 +2473,10 @@ export default {
1
],
"dateGranularity": [
- 114
+ 115
],
"orderBy": [
- 115
+ 116
],
"manualSortOrder": [
1
@@ -2489,7 +2494,7 @@ export default {
8
],
"numberFormat": [
- 111
+ 112
],
"splitMultiValueFields": [
8
@@ -2507,7 +2512,7 @@ export default {
1
],
"firstDayOfTheWeek": [
- 30
+ 31
],
"__typename": [
1
@@ -2517,13 +2522,13 @@ export default {
"GraphOrderBy": {},
"LineChartConfiguration": {
"configurationType": [
- 110
+ 111
],
"aggregateFieldMetadataId": [
3
],
"aggregateOperation": [
- 56
+ 57
],
"primaryAxisGroupByFieldMetadataId": [
3
@@ -2532,10 +2537,10 @@ export default {
1
],
"primaryAxisDateGranularity": [
- 114
+ 115
],
"primaryAxisOrderBy": [
- 115
+ 116
],
"primaryAxisManualSortOrder": [
1
@@ -2547,10 +2552,10 @@ export default {
1
],
"secondaryAxisGroupByDateGranularity": [
- 114
+ 115
],
"secondaryAxisOrderBy": [
- 115
+ 116
],
"secondaryAxisManualSortOrder": [
1
@@ -2562,7 +2567,7 @@ export default {
8
],
"axisNameDisplay": [
- 117
+ 118
],
"displayDataLabel": [
8
@@ -2571,7 +2576,7 @@ export default {
8
],
"numberFormat": [
- 111
+ 112
],
"rangeMin": [
15
@@ -2598,7 +2603,7 @@ export default {
1
],
"firstDayOfTheWeek": [
- 30
+ 31
],
"__typename": [
1
@@ -2607,7 +2612,7 @@ export default {
"AxisNameDisplay": {},
"IframeConfiguration": {
"configurationType": [
- 110
+ 111
],
"url": [
1
@@ -2618,13 +2623,13 @@ export default {
},
"BarChartConfiguration": {
"configurationType": [
- 110
+ 111
],
"aggregateFieldMetadataId": [
3
],
"aggregateOperation": [
- 56
+ 57
],
"primaryAxisGroupByFieldMetadataId": [
3
@@ -2633,10 +2638,10 @@ export default {
1
],
"primaryAxisDateGranularity": [
- 114
+ 115
],
"primaryAxisOrderBy": [
- 115
+ 116
],
"primaryAxisManualSortOrder": [
1
@@ -2648,10 +2653,10 @@ export default {
1
],
"secondaryAxisGroupByDateGranularity": [
- 114
+ 115
],
"secondaryAxisOrderBy": [
- 115
+ 116
],
"secondaryAxisManualSortOrder": [
1
@@ -2663,7 +2668,7 @@ export default {
8
],
"axisNameDisplay": [
- 117
+ 118
],
"displayDataLabel": [
8
@@ -2672,7 +2677,7 @@ export default {
8
],
"numberFormat": [
- 111
+ 112
],
"rangeMin": [
15
@@ -2690,10 +2695,10 @@ export default {
9
],
"groupMode": [
- 120
+ 121
],
"layout": [
- 121
+ 122
],
"isCumulative": [
8
@@ -2702,7 +2707,7 @@ export default {
1
],
"firstDayOfTheWeek": [
- 30
+ 31
],
"__typename": [
1
@@ -2712,7 +2717,7 @@ export default {
"BarChartLayout": {},
"CalendarConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2720,7 +2725,7 @@ export default {
},
"FrontComponentConfiguration": {
"configurationType": [
- 110
+ 111
],
"frontComponentId": [
3
@@ -2734,7 +2739,7 @@ export default {
},
"EmailsConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2742,7 +2747,7 @@ export default {
},
"EmailThreadConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2750,7 +2755,7 @@ export default {
},
"CallRecordingSummaryConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2758,7 +2763,7 @@ export default {
},
"CallRecordingTranscriptConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2766,7 +2771,7 @@ export default {
},
"ChatThreadsConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2774,7 +2779,7 @@ export default {
},
"ChatConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2782,7 +2787,7 @@ export default {
},
"MessageCampaignBodyConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2790,7 +2795,7 @@ export default {
},
"MessageCampaignDetailsConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2798,13 +2803,13 @@ export default {
},
"FieldConfiguration": {
"configurationType": [
- 110
+ 111
],
"fieldMetadataId": [
1
],
"fieldDisplayMode": [
- 133
+ 134
],
"viewId": [
1
@@ -2822,7 +2827,7 @@ export default {
"FieldDisplayMode": {},
"FieldRichTextConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2830,7 +2835,7 @@ export default {
},
"FieldsConfiguration": {
"configurationType": [
- 110
+ 111
],
"viewId": [
1
@@ -2847,7 +2852,7 @@ export default {
},
"FormFieldConfiguration": {
"configurationType": [
- 110
+ 111
],
"fieldMetadataId": [
1
@@ -2858,7 +2863,7 @@ export default {
},
"FilesConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2866,7 +2871,7 @@ export default {
},
"NotesConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2874,7 +2879,7 @@ export default {
},
"TasksConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2882,7 +2887,7 @@ export default {
},
"TimelineConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2890,7 +2895,7 @@ export default {
},
"ViewConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2898,13 +2903,13 @@ export default {
},
"RecordTableConfiguration": {
"configurationType": [
- 110
+ 111
],
"viewId": [
1
],
"recordLimit": [
- 30
+ 31
],
"isUIEditable": [
8
@@ -2915,7 +2920,7 @@ export default {
},
"WorkflowConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2923,7 +2928,7 @@ export default {
},
"WorkflowRunConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2931,7 +2936,7 @@ export default {
},
"WorkflowVersionConfiguration": {
"configurationType": [
- 110
+ 111
],
"__typename": [
1
@@ -2960,13 +2965,13 @@ export default {
3
],
"widgets": [
- 100
+ 101
],
"icon": [
1
],
"layoutMode": [
- 104
+ 105
],
"createdAt": [
4
@@ -2995,13 +3000,13 @@ export default {
1
],
"type": [
- 148
+ 149
],
"objectMetadataId": [
3
],
"tabs": [
- 146
+ 147
],
"defaultTabToFocusOnMobileAndSidePanelId": [
3
@@ -3060,7 +3065,7 @@ export default {
1
],
"oauth": [
- 149
+ 150
],
"logoUrl": [
1
@@ -3080,7 +3085,7 @@ export default {
15
],
"status": [
- 152
+ 153
],
"error": [
9
@@ -3132,13 +3137,13 @@ export default {
},
"UsageQuotaDefinition": {
"resourceType": [
- 156
+ 157
],
"limitKind": [
1
],
"allowedOperationTypes": [
- 157
+ 158
],
"allowedSpenderTypes": [
1
@@ -3154,7 +3159,7 @@ export default {
"UsageOperationType": {},
"UsageQuotaDefinitions": {
"definitions": [
- 155
+ 156
],
"isIntraWorkspaceLimitEntitled": [
8
@@ -3171,10 +3176,10 @@ export default {
3
],
"resourceType": [
- 156
+ 157
],
"operationType": [
- 157
+ 158
],
"spenderType": [
1
@@ -3192,16 +3197,16 @@ export default {
1
],
"limitValue": [
- 160
+ 161
],
"isEnforced": [
8
],
"consumedValue": [
- 160
+ 161
],
"remainingValue": [
- 160
+ 161
],
"periodStart": [
4
@@ -3216,7 +3221,7 @@ export default {
"BigInt": {},
"UsageQuotaScopeConsumption": {
"consumedValue": [
- 160
+ 161
],
"periodStart": [
4
@@ -3233,10 +3238,10 @@ export default {
3
],
"resourceType": [
- 156
+ 157
],
"operationType": [
- 157
+ 158
],
"spenderType": [
1
@@ -3248,7 +3253,7 @@ export default {
1
],
"periodCount": [
- 30
+ 31
],
"periodUnit": [
1
@@ -3257,10 +3262,10 @@ export default {
1
],
"limitValue": [
- 160
+ 161
],
"burstValue": [
- 160
+ 161
],
"createdAt": [
4
@@ -3340,7 +3345,7 @@ export default {
3
],
"type": [
- 167
+ 168
],
"name": [
1
@@ -3373,7 +3378,7 @@ export default {
4
],
"targetRecordIdentifier": [
- 165
+ 166
],
"__typename": [
1
@@ -3399,7 +3404,7 @@ export default {
},
"RecordSharingGrantDTO": {
"id": [
- 170
+ 171
],
"principalType": [
1
@@ -3408,7 +3413,7 @@ export default {
3
],
"accessLevel": [
- 171
+ 172
],
"rowCause": [
1
@@ -3432,10 +3437,10 @@ export default {
},
"RecordSharingDTO": {
"viewerAccessLevel": [
- 171
+ 172
],
"permissions": [
- 168
+ 169
],
"isEnabled": [
8
@@ -3447,16 +3452,16 @@ export default {
8
],
"generalAccessLevel": [
- 171
+ 172
],
"isGeneralAccessDefault": [
8
],
"roles": [
- 172
+ 173
],
"shares": [
- 169
+ 170
],
"__typename": [
1
@@ -3467,10 +3472,10 @@ export default {
1
],
"state": [
- 175
+ 176
],
"attemptsMade": [
- 30
+ 31
],
"failedReason": [
1
@@ -3508,7 +3513,7 @@ export default {
},
"MetadataEvent": {
"type": [
- 178
+ 179
],
"metadataName": [
1
@@ -3517,7 +3522,7 @@ export default {
1
],
"properties": [
- 176
+ 177
],
"updatedCollectionHash": [
1
@@ -3529,7 +3534,7 @@ export default {
"MetadataEventAction": {},
"ObjectRecordEvent": {
"action": [
- 180
+ 181
],
"objectNameSingular": [
1
@@ -3544,7 +3549,7 @@ export default {
1
],
"properties": [
- 176
+ 177
],
"__typename": [
1
@@ -3556,7 +3561,7 @@ export default {
1
],
"objectRecordEvent": [
- 179
+ 180
],
"__typename": [
1
@@ -3567,13 +3572,13 @@ export default {
1
],
"objectRecordEventsWithQueryIds": [
- 181
+ 182
],
"metadataEvents": [
- 177
+ 178
],
"queueJobEvents": [
- 174
+ 175
],
"__typename": [
1
@@ -3616,7 +3621,7 @@ export default {
},
"BillingEndTrialPeriod": {
"status": [
- 94
+ 95
],
"hasPaymentMethod": [
8
@@ -3625,10 +3630,10 @@ export default {
1
],
"currentBillingSubscription": [
- 93
+ 94
],
"billingSubscriptions": [
- 93
+ 94
],
"__typename": [
1
@@ -3636,7 +3641,7 @@ export default {
},
"BillingResourceCreditUsage": {
"productKey": [
- 84
+ 85
],
"periodStart": [
4
@@ -3665,16 +3670,16 @@ export default {
},
"BillingPlan": {
"planKey": [
- 82
+ 83
],
"baseProducts": [
- 90
+ 91
],
"resourceCreditProducts": [
- 90
+ 91
],
"meteredProducts": [
- 91
+ 92
],
"__typename": [
1
@@ -3701,10 +3706,10 @@ export default {
},
"BillingUpdate": {
"currentBillingSubscription": [
- 93
+ 94
],
"billingSubscriptions": [
- 93
+ 94
],
"__typename": [
1
@@ -3740,7 +3745,7 @@ export default {
1
],
"dailyUsage": [
- 191
+ 192
],
"__typename": [
1
@@ -3748,19 +3753,19 @@ export default {
},
"UsageAnalytics": {
"usageByUser": [
- 190
+ 191
],
"usageByOperationType": [
- 190
+ 191
],
"usageByApplication": [
- 190
+ 191
],
"usageByModel": [
- 190
+ 191
],
"timeSeries": [
- 191
+ 192
],
"periodStart": [
4
@@ -3769,7 +3774,7 @@ export default {
4
],
"userDailyUsage": [
- 192
+ 193
],
"__typename": [
1
@@ -3805,10 +3810,10 @@ export default {
},
"OnboardingStepNavigation": {
"onboardingStatus": [
- 76
+ 77
],
"previousOnboardingStatus": [
- 76
+ 77
],
"__typename": [
1
@@ -3847,7 +3852,7 @@ export default {
1
],
"result": [
- 198
+ 199
],
"__typename": [
1
@@ -3864,7 +3869,7 @@ export default {
1
],
"connectionSecurity": [
- 201
+ 202
],
"__typename": [
1
@@ -3873,13 +3878,13 @@ export default {
"EmailConnectionSecurity": {},
"PublicImapSmtpCaldavConnectionParameters": {
"IMAP": [
- 200
+ 201
],
"SMTP": [
- 200
+ 201
],
"CALDAV": [
- 200
+ 201
],
"__typename": [
1
@@ -3938,7 +3943,7 @@ export default {
4
],
"connectionParameters": [
- 202
+ 203
],
"__typename": [
1
@@ -3997,7 +4002,7 @@ export default {
4
],
"connectionParameters": [
- 202
+ 203
],
"isOwnedByCurrentUser": [
8
@@ -4008,7 +4013,7 @@ export default {
},
"FeatureFlag": {
"key": [
- 206
+ 207
],
"value": [
8
@@ -4075,7 +4080,7 @@ export default {
1
],
"count": [
- 30
+ 31
],
"__typename": [
1
@@ -4083,16 +4088,16 @@ export default {
},
"ApplicationRegistrationStats": {
"activeInstalls": [
- 30
+ 31
],
"suspendedInstalls": [
- 30
+ 31
],
"mostInstalledVersion": [
1
],
"versionDistribution": [
- 209
+ 210
],
"__typename": [
1
@@ -4117,10 +4122,10 @@ export default {
1
],
"type": [
- 213
+ 214
],
"status": [
- 214
+ 215
],
"issuer": [
1
@@ -4133,7 +4138,7 @@ export default {
"SSOIdentityProviderStatus": {},
"AuthProviders": {
"sso": [
- 212
+ 213
],
"google": [
8
@@ -4170,10 +4175,10 @@ export default {
3
],
"authProviders": [
- 215
+ 216
],
"authBypassProviders": [
- 216
+ 217
],
"logo": [
1
@@ -4182,7 +4187,7 @@ export default {
1
],
"workspaceUrls": [
- 207
+ 208
],
"__typename": [
1
@@ -4221,7 +4226,7 @@ export default {
1
],
"modelFamily": [
- 221
+ 222
],
"modelFamilyLabel": [
1
@@ -4236,7 +4241,7 @@ export default {
15
],
"nativeCapabilities": [
- 219
+ 220
],
"isDeprecated": [
8
@@ -4322,7 +4327,7 @@ export default {
},
"ClientAiModelTierConfig": {
"tier": [
- 74
+ 75
],
"modelId": [
1
@@ -4342,7 +4347,7 @@ export default {
1
],
"trialPeriods": [
- 211
+ 212
],
"__typename": [
1
@@ -4350,7 +4355,7 @@ export default {
},
"Support": {
"supportDriver": [
- 226
+ 227
],
"supportFrontChatId": [
1
@@ -4379,7 +4384,7 @@ export default {
},
"Captcha": {
"provider": [
- 229
+ 230
],
"siteKey": [
1
@@ -4416,10 +4421,10 @@ export default {
},
"PublicFeatureFlag": {
"key": [
- 206
+ 207
],
"metadata": [
- 231
+ 232
],
"__typename": [
1
@@ -4444,19 +4449,19 @@ export default {
1
],
"authProviders": [
- 215
+ 216
],
"billing": [
- 224
+ 225
],
"aiModels": [
- 220
+ 221
],
"aiEvaluationModels": [
- 222
+ 223
],
"aiModelTiers": [
- 223
+ 224
],
"signInPrefilled": [
8
@@ -4480,25 +4485,25 @@ export default {
8
],
"support": [
- 225
+ 226
],
"isAttachmentPreviewEnabled": [
8
],
"sentry": [
- 227
+ 228
],
"captcha": [
- 228
+ 229
],
"api": [
- 230
+ 231
],
"canManageFeatureFlags": [
8
],
"publicFeatureFlags": [
- 232
+ 233
],
"isCookieSessionEnabled": [
8
@@ -4552,7 +4557,7 @@ export default {
1
],
"maintenance": [
- 233
+ 234
],
"__typename": [
1
@@ -4589,7 +4594,7 @@ export default {
},
"CreateApplicationRegistration": {
"applicationRegistration": [
- 78
+ 79
],
"clientSecret": [
1
@@ -4628,7 +4633,7 @@ export default {
},
"AppConnection": {
"id": [
- 170
+ 171
],
"providerName": [
1
@@ -4685,7 +4690,7 @@ export default {
3
],
"type": [
- 213
+ 214
],
"issuer": [
1
@@ -4694,7 +4699,7 @@ export default {
1
],
"status": [
- 214
+ 215
],
"__typename": [
1
@@ -4713,7 +4718,7 @@ export default {
},
"FindAvailableSSOIDP": {
"type": [
- 213
+ 214
],
"id": [
3
@@ -4725,10 +4730,10 @@ export default {
1
],
"status": [
- 214
+ 215
],
"workspace": [
- 243
+ 244
],
"__typename": [
1
@@ -4739,7 +4744,7 @@ export default {
3
],
"type": [
- 213
+ 214
],
"issuer": [
1
@@ -4748,7 +4753,7 @@ export default {
1
],
"status": [
- 214
+ 215
],
"__typename": [
1
@@ -4756,7 +4761,7 @@ export default {
},
"SSOConnection": {
"type": [
- 213
+ 214
],
"id": [
3
@@ -4768,7 +4773,7 @@ export default {
1
],
"status": [
- 214
+ 215
],
"__typename": [
1
@@ -4791,13 +4796,13 @@ export default {
1
],
"workspaceUrls": [
- 207
+ 208
],
"logo": [
1
],
"sso": [
- 246
+ 247
],
"__typename": [
1
@@ -4805,10 +4810,10 @@ export default {
},
"AvailableWorkspaces": {
"availableWorkspacesForSignIn": [
- 247
+ 248
],
"availableWorkspacesForSignUp": [
- 247
+ 248
],
"__typename": [
1
@@ -4819,7 +4824,7 @@ export default {
3
],
"name": [
- 36
+ 37
],
"userEmail": [
1
@@ -4847,7 +4852,7 @@ export default {
},
"ApplicationHealthCheckResult": {
"status": [
- 252
+ 253
],
"title": [
1
@@ -4856,7 +4861,7 @@ export default {
1
],
"action": [
- 250
+ 251
],
"__typename": [
1
@@ -4970,10 +4975,10 @@ export default {
1
],
"objectPermissions": [
- 254
+ 255
],
"fieldPermissions": [
- 255
+ 256
],
"__typename": [
1
@@ -5041,13 +5046,13 @@ export default {
1
],
"installCount": [
- 30
+ 31
],
"defaultRoleUniversalIdentifier": [
1
],
"roles": [
- 256
+ 257
],
"requestedCapabilities": [
1
@@ -5088,13 +5093,13 @@ export default {
},
"WorkspaceCompanyEnrichmentResult": {
"outcome": [
- 262
+ 263
],
"enrichment": [
9
],
"personOutcome": [
- 263
+ 264
],
"personEnrichment": [
9
@@ -5116,7 +5121,7 @@ export default {
1
],
"type": [
- 265
+ 266
],
"name": [
1
@@ -5140,7 +5145,7 @@ export default {
8
],
"writability": [
- 28
+ 29
],
"isUIReadOnly": [
8
@@ -5188,10 +5193,10 @@ export default {
25
],
"relation": [
- 269
+ 270
],
"morphRelations": [
- 269
+ 270
],
"__typename": [
1
@@ -5206,10 +5211,10 @@ export default {
8
],
"startCursor": [
- 31
+ 32
],
"endCursor": [
- 31
+ 32
],
"__typename": [
1
@@ -5217,10 +5222,10 @@ export default {
},
"FieldEdge": {
"node": [
- 264
+ 265
],
"cursor": [
- 31
+ 32
],
"__typename": [
1
@@ -5228,10 +5233,10 @@ export default {
},
"FieldConnection": {
"pageInfo": [
- 266
+ 267
],
"edges": [
- 267
+ 268
],
"__typename": [
1
@@ -5239,7 +5244,7 @@ export default {
},
"Relation": {
"type": [
- 270
+ 271
],
"sourceObjectMetadata": [
25
@@ -5248,10 +5253,10 @@ export default {
25
],
"sourceFieldMetadata": [
- 264
+ 265
],
"targetFieldMetadata": [
- 264
+ 265
],
"__typename": [
1
@@ -5298,7 +5303,7 @@ export default {
1
],
"indexType": [
- 273
+ 274
],
"createdAt": [
4
@@ -5307,7 +5312,7 @@ export default {
4
],
"indexFieldMetadataList": [
- 271
+ 272
],
"__typename": [
1
@@ -5316,10 +5321,10 @@ export default {
"IndexType": {},
"IndexEdge": {
"node": [
- 272
+ 273
],
"cursor": [
- 31
+ 32
],
"__typename": [
1
@@ -5330,7 +5335,7 @@ export default {
25
],
"cursor": [
- 31
+ 32
],
"__typename": [
1
@@ -5338,10 +5343,10 @@ export default {
},
"ObjectConnection": {
"pageInfo": [
- 266
+ 267
],
"edges": [
- 275
+ 276
],
"__typename": [
1
@@ -5349,10 +5354,10 @@ export default {
},
"ObjectFieldsConnection": {
"pageInfo": [
- 266
+ 267
],
"edges": [
- 267
+ 268
],
"__typename": [
1
@@ -5360,10 +5365,10 @@ export default {
},
"ObjectIndexMetadatasConnection": {
"pageInfo": [
- 266
+ 267
],
"edges": [
- 274
+ 275
],
"__typename": [
1
@@ -5374,7 +5379,7 @@ export default {
1
],
"totalCount": [
- 30
+ 31
],
"__typename": [
1
@@ -5405,7 +5410,7 @@ export default {
},
"BillingEntitlement": {
"key": [
- 282
+ 283
],
"value": [
8
@@ -5443,7 +5448,7 @@ export default {
1
],
"records": [
- 283
+ 284
],
"isCustomDomainEnabled": [
8
@@ -5454,10 +5459,10 @@ export default {
},
"UpsertRowLevelPermissionPredicatesResult": {
"predicates": [
- 45
+ 46
],
"predicateGroups": [
- 43
+ 44
],
"__typename": [
1
@@ -5522,10 +5527,10 @@ export default {
},
"AvailableWorkspacesAndAccessTokens": {
"tokens": [
- 291
+ 292
],
"availableWorkspaces": [
- 248
+ 249
],
"__typename": [
1
@@ -5563,7 +5568,7 @@ export default {
},
"WorkspaceUrlsAndId": {
"workspaceUrls": [
- 207
+ 208
],
"id": [
3
@@ -5577,7 +5582,7 @@ export default {
11
],
"workspace": [
- 296
+ 297
],
"__typename": [
1
@@ -5610,7 +5615,7 @@ export default {
11
],
"workspaceUrls": [
- 207
+ 208
],
"__typename": [
1
@@ -5654,7 +5659,7 @@ export default {
},
"AuthTokens": {
"tokens": [
- 291
+ 292
],
"__typename": [
1
@@ -5695,7 +5700,7 @@ export default {
11
],
"workspace": [
- 296
+ 297
],
"__typename": [
1
@@ -5763,7 +5768,7 @@ export default {
1
],
"status": [
- 313
+ 314
],
"reason": [
1
@@ -5789,16 +5794,16 @@ export default {
},
"ApplicationExport": {
"application": [
- 311
+ 312
],
"manifest": [
9
],
"coverage": [
- 312
+ 313
],
"files": [
- 314
+ 315
],
"__typename": [
1
@@ -5834,10 +5839,10 @@ export default {
},
"CompleteApplicationFileUploadsResult": {
"files": [
- 316
+ 317
],
"errors": [
- 317
+ 318
],
"__typename": [
1
@@ -5848,7 +5853,7 @@ export default {
3
],
"fileFolder": [
- 320
+ 321
],
"filePath": [
1
@@ -5869,7 +5874,7 @@ export default {
"FileFolder": {},
"ApplicationFileUploadError": {
"fileFolder": [
- 320
+ 321
],
"filePath": [
1
@@ -5883,10 +5888,10 @@ export default {
},
"CreateApplicationFileUploadsResult": {
"targets": [
- 319
+ 320
],
"errors": [
- 321
+ 322
],
"__typename": [
1
@@ -5968,16 +5973,16 @@ export default {
1
],
"status": [
- 328
+ 329
],
"tenantStatus": [
- 329
+ 330
],
"unsubscribeHostnameStatus": [
- 330
+ 331
],
"verificationRecords": [
- 326
+ 327
],
"verifiedAt": [
4
@@ -5994,7 +5999,7 @@ export default {
3
],
"visibility": [
- 332
+ 333
],
"handle": [
1
@@ -6003,16 +6008,16 @@ export default {
1
],
"type": [
- 333
+ 334
],
"isContactAutoCreationEnabled": [
8
],
"contactAutoCreationPolicy": [
- 334
+ 335
],
"messageFolderImportPolicy": [
- 335
+ 336
],
"excludeNonProfessionalEmails": [
8
@@ -6021,7 +6026,7 @@ export default {
8
],
"pendingGroupEmailsAction": [
- 336
+ 337
],
"isSyncEnabled": [
8
@@ -6030,10 +6035,10 @@ export default {
4
],
"syncStatus": [
- 337
+ 338
],
"syncStage": [
- 338
+ 339
],
"syncStageStartedAt": [
4
@@ -6054,7 +6059,7 @@ export default {
4
],
"connectedAccount": [
- 203
+ 204
],
"__typename": [
1
@@ -6083,7 +6088,7 @@ export default {
},
"IngestAppMessagesOutput": {
"messages": [
- 339
+ 340
],
"__typename": [
1
@@ -6091,7 +6096,7 @@ export default {
},
"CreateEmailGroupChannelOutput": {
"messageChannel": [
- 331
+ 332
],
"forwardingAddress": [
1
@@ -6102,28 +6107,28 @@ export default {
},
"CampaignAudiencePreviewDTO": {
"totalMembers": [
- 30
+ 31
],
"withoutEmail": [
- 30
+ 31
],
"duplicateEmails": [
- 30
+ 31
],
"hardSuppressed": [
- 30
+ 31
],
"globallyUnsubscribed": [
- 30
+ 31
],
"topicUnsubscribed": [
- 30
+ 31
],
"trackingRefused": [
- 30
+ 31
],
"sendable": [
- 30
+ 31
],
"__typename": [
1
@@ -6134,7 +6139,7 @@ export default {
1
],
"canceledMessageCount": [
- 30
+ 31
],
"__typename": [
1
@@ -6153,10 +6158,10 @@ export default {
1
],
"queuedCount": [
- 30
+ 31
],
"audience": [
- 342
+ 343
],
"__typename": [
1
@@ -6199,10 +6204,10 @@ export default {
1
],
"reason": [
- 348
+ 349
],
"source": [
- 349
+ 350
],
"unsubscribeTopicId": [
3
@@ -6215,10 +6220,10 @@ export default {
"MessageSuppressionSource": {},
"MessageSuppressionList": {
"records": [
- 347
+ 348
],
"totalCount": [
- 30
+ 31
],
"__typename": [
1
@@ -6241,7 +6246,7 @@ export default {
1
],
"visibility": [
- 352
+ 353
],
"__typename": [
1
@@ -6287,7 +6292,7 @@ export default {
1
],
"location": [
- 354
+ 355
],
"__typename": [
1
@@ -6304,7 +6309,7 @@ export default {
1
],
"connectionSecurity": [
- 201
+ 202
],
"__typename": [
1
@@ -6315,13 +6320,13 @@ export default {
1
],
"IMAP": [
- 356
+ 357
],
"SMTP": [
- 356
+ 357
],
"CALDAV": [
- 356
+ 357
],
"__typename": [
1
@@ -6341,7 +6346,7 @@ export default {
3
],
"connectionParameters": [
- 357
+ 358
],
"__typename": [
1
@@ -6366,7 +6371,7 @@ export default {
3
],
"orderIndex": [
- 30
+ 31
],
"type": [
1
@@ -6467,7 +6472,7 @@ export default {
1
],
"parts": [
- 360
+ 361
],
"processedAt": [
4
@@ -6607,7 +6612,7 @@ export default {
1
],
"series": [
- 367
+ 368
],
"xAxisLabel": [
1
@@ -6622,10 +6627,10 @@ export default {
8
],
"layout": [
- 121
+ 122
],
"groupMode": [
- 120
+ 121
],
"hasTooManyGroups": [
8
@@ -6656,7 +6661,7 @@ export default {
1
],
"data": [
- 369
+ 370
],
"__typename": [
1
@@ -6664,7 +6669,7 @@ export default {
},
"LineChartData": {
"series": [
- 370
+ 371
],
"xAxisLabel": [
1
@@ -6701,7 +6706,7 @@ export default {
},
"PieChartData": {
"data": [
- 372
+ 373
],
"showLegend": [
8
@@ -6747,10 +6752,10 @@ export default {
},
"AiChatUsage": {
"limitValue": [
- 160
+ 161
],
"consumedValue": [
- 160
+ 161
],
"periodEnd": [
4
@@ -6805,25 +6810,25 @@ export default {
},
"AgentChatThread": {
"id": [
- 170
+ 171
],
"title": [
1
],
"totalCacheReadTokens": [
- 30
+ 31
],
"totalInputTokens": [
- 30
+ 31
],
"totalOutputTokens": [
- 30
+ 31
],
"contextWindowTokens": [
- 30
+ 31
],
"conversationSize": [
- 30
+ 31
],
"totalInputCredits": [
15
@@ -6852,7 +6857,7 @@ export default {
1
],
"estimatedTokenCount": [
- 30
+ 31
],
"__typename": [
1
@@ -6860,10 +6865,10 @@ export default {
},
"AiSystemPromptPreview": {
"sections": [
- 378
+ 379
],
"estimatedTokenCount": [
- 30
+ 31
],
"__typename": [
1
@@ -6885,10 +6890,10 @@ export default {
9
],
"maxSeq": [
- 30
+ 31
],
"error": [
- 380
+ 381
],
"__typename": [
1
@@ -6929,10 +6934,10 @@ export default {
},
"StartWorkspaceSetupChatResult": {
"outcome": [
- 386
+ 387
],
"thread": [
- 377
+ 378
],
"__typename": [
1
@@ -7000,13 +7005,13 @@ export default {
},
"EventLogQueryResult": {
"records": [
- 389
+ 390
],
"totalCount": [
- 30
+ 31
],
"pageInfo": [
- 390
+ 391
],
"__typename": [
1
@@ -7020,7 +7025,7 @@ export default {
1
],
"progress": [
- 30
+ 31
],
"errorMessage": [
1
@@ -7040,7 +7045,7 @@ export default {
3
],
"permissions": [
- 168
+ 169
],
"__typename": [
1
@@ -7054,7 +7059,7 @@ export default {
3
],
"score": [
- 30
+ 31
],
"comment": [
1
@@ -7077,10 +7082,10 @@ export default {
3
],
"evaluations": [
- 394
+ 395
],
"messages": [
- 361
+ 362
],
"createdAt": [
4
@@ -7091,13 +7096,13 @@ export default {
},
"WorkspaceAiStats": {
"conversationsCount": [
- 30
+ 31
],
"skillsCount": [
- 30
+ 31
],
"toolsCount": [
- 30
+ 31
],
"__typename": [
1
@@ -7125,7 +7130,7 @@ export default {
1
],
"enqueuedJobsCount": [
- 30
+ 31
],
"jobIds": [
1
@@ -7142,7 +7147,7 @@ export default {
9
],
"scope": [
- 400
+ 401
],
"__typename": [
1
@@ -7157,19 +7162,19 @@ export default {
1
],
"syncStatus": [
- 402
+ 403
],
"syncStage": [
- 403
+ 404
],
"visibility": [
- 404
+ 405
],
"isContactAutoCreationEnabled": [
8
],
"contactAutoCreationPolicy": [
- 405
+ 406
],
"isSyncEnabled": [
8
@@ -7220,7 +7225,7 @@ export default {
1
],
"pendingSyncAction": [
- 407
+ 408
],
"messageChannelId": [
3
@@ -7262,7 +7267,7 @@ export default {
1
],
"provenance": [
- 409
+ 410
],
"__typename": [
1
@@ -7291,7 +7296,7 @@ export default {
3
],
"through": [
- 410
+ 411
],
"__typename": [
1
@@ -7311,7 +7316,7 @@ export default {
1
],
"emit": [
- 411
+ 412
],
"action": [
1
@@ -7413,7 +7418,7 @@ export default {
},
"CollectionHash": {
"collectionName": [
- 416
+ 417
],
"hash": [
1
@@ -7463,10 +7468,10 @@ export default {
3
],
"type": [
- 66
+ 67
],
"key": [
- 67
+ 68
],
"objectMetadataId": [
3
@@ -7477,13 +7482,13 @@ export default {
},
"MinimalMetadata": {
"objectMetadataItems": [
- 417
+ 418
],
"views": [
- 418
+ 419
],
"collectionHashes": [
- 415
+ 416
],
"__typename": [
1
@@ -7491,19 +7496,19 @@ export default {
},
"Query": {
"recordSharing": [
- 173,
+ 174,
{
"target": [
- 421,
+ 422,
"RecordSharingTargetInput!"
]
}
],
"navigationMenuItems": [
- 166
+ 167
],
"navigationMenuItem": [
- 166,
+ 167,
{
"id": [
3,
@@ -7528,10 +7533,10 @@ export default {
}
],
"enterpriseSubscriptionStatus": [
- 154
+ 155
],
"applicationSdkClientChecksums": [
- 96,
+ 97,
{
"applicationId": [
3,
@@ -7549,25 +7554,25 @@ export default {
}
],
"usageLimits": [
- 162
+ 163
],
"usageQuotasWithConsumption": [
- 159
+ 160
],
"usageQuotaDefinitions": [
- 158
+ 159
],
"usageQuotaScopeConsumption": [
- 161,
+ 162,
{
"input": [
- 422,
+ 423,
"UsageQuotaScopeInput!"
]
}
],
"getPageLayoutWidgets": [
- 100,
+ 101,
{
"pageLayoutTabId": [
1,
@@ -7576,7 +7581,7 @@ export default {
}
],
"getPageLayoutWidget": [
- 100,
+ 101,
{
"id": [
1,
@@ -7585,7 +7590,7 @@ export default {
}
],
"getPageLayoutTabs": [
- 146,
+ 147,
{
"pageLayoutId": [
1,
@@ -7594,7 +7599,7 @@ export default {
}
],
"getPageLayoutTab": [
- 146,
+ 147,
{
"id": [
1,
@@ -7603,18 +7608,18 @@ export default {
}
],
"getPageLayouts": [
- 147,
+ 148,
{
"objectMetadataId": [
1
],
"pageLayoutType": [
- 148
+ 149
]
}
],
"getPageLayout": [
- 147,
+ 148,
{
"id": [
1,
@@ -7623,19 +7628,19 @@ export default {
}
],
"getViews": [
- 65,
+ 66,
{
"objectMetadataId": [
1
],
"viewTypes": [
- 66,
+ 67,
"[ViewType!]"
]
}
],
"getView": [
- 65,
+ 66,
{
"id": [
1,
@@ -7644,7 +7649,7 @@ export default {
}
],
"getViewSorts": [
- 62,
+ 63,
{
"viewId": [
1
@@ -7652,7 +7657,7 @@ export default {
}
],
"getViewSort": [
- 62,
+ 63,
{
"id": [
1,
@@ -7661,7 +7666,7 @@ export default {
}
],
"getViewFilters": [
- 59,
+ 60,
{
"viewId": [
1
@@ -7669,7 +7674,7 @@ export default {
}
],
"getViewFilter": [
- 59,
+ 60,
{
"id": [
1,
@@ -7678,7 +7683,7 @@ export default {
}
],
"getViewFields": [
- 55,
+ 56,
{
"viewId": [
1,
@@ -7687,7 +7692,7 @@ export default {
}
],
"getViewField": [
- 55,
+ 56,
{
"id": [
1,
@@ -7696,7 +7701,7 @@ export default {
}
],
"getViewFieldGroups": [
- 64,
+ 65,
{
"viewId": [
1,
@@ -7705,7 +7710,7 @@ export default {
}
],
"getViewFieldGroup": [
- 64,
+ 65,
{
"id": [
1,
@@ -7720,20 +7725,20 @@ export default {
10,
{
"input": [
- 423,
+ 424,
"AgentIdInput!"
]
}
],
"objects": [
- 276,
+ 277,
{
"paging": [
- 29,
+ 30,
"CursorPaging!"
],
"filter": [
- 424,
+ 425,
"ObjectFilter!"
]
}
@@ -7748,7 +7753,7 @@ export default {
}
],
"objectRecordCounts": [
- 279
+ 280
],
"mostlyEmptyFieldMetadataIds": [
3,
@@ -7760,13 +7765,13 @@ export default {
}
],
"currentUserSessions": [
- 183
+ 184
],
"findOneLogicFunction": [
23,
{
"input": [
- 425,
+ 426,
"LogicFunctionIdInput!"
]
}
@@ -7778,7 +7783,7 @@ export default {
9,
{
"input": [
- 425,
+ 426,
"LogicFunctionIdInput!"
]
}
@@ -7787,7 +7792,7 @@ export default {
1,
{
"input": [
- 425,
+ 426,
"LogicFunctionIdInput!"
]
}
@@ -7817,10 +7822,10 @@ export default {
}
],
"getInviteSuggestions": [
- 195
+ 196
],
"applicationConnectionProviders": [
- 150,
+ 151,
{
"applicationId": [
3,
@@ -7829,15 +7834,15 @@ export default {
}
],
"getUsageAnalytics": [
- 193,
+ 194,
{
"input": [
- 426
+ 427
]
}
],
"billingPortalSession": [
- 188,
+ 189,
{
"returnUrlPath": [
1
@@ -7848,37 +7853,37 @@ export default {
}
],
"listPlans": [
- 186
+ 187
],
"getResourceCreditUsage": [
- 185
+ 186
],
"findWorkspaceInvitations": [
- 198
+ 199
],
"getApprovedAccessDomains": [
- 194
+ 195
],
"getRoles": [
- 50
+ 51
],
"apiKeys": [
2
],
"getApiKeyRoles": [
- 50
+ 51
],
"apiKey": [
2,
{
"input": [
- 427,
+ 428,
"GetApiKeyInput!"
]
}
],
"getViewFilterGroups": [
- 57,
+ 58,
{
"viewId": [
1
@@ -7886,7 +7891,7 @@ export default {
}
],
"getViewFilterGroup": [
- 57,
+ 58,
{
"id": [
1,
@@ -7895,10 +7900,10 @@ export default {
}
],
"myConnectedAccounts": [
- 203
+ 204
],
"applicationConnectedAccounts": [
- 204,
+ 205,
{
"applicationId": [
3,
@@ -7907,10 +7912,10 @@ export default {
}
],
"currentWorkspace": [
- 71
+ 72
],
"getPublicWorkspaceDataByDomain": [
- 217,
+ 218,
{
"origin": [
1
@@ -7918,7 +7923,7 @@ export default {
}
],
"getPublicWorkspaceDataById": [
- 218,
+ 219,
{
"id": [
3,
@@ -7927,7 +7932,7 @@ export default {
}
],
"findApplicationRegistrationByClientId": [
- 237,
+ 238,
{
"clientId": [
1,
@@ -7936,7 +7941,7 @@ export default {
}
],
"findApplicationRegistrationByUniversalIdentifier": [
- 78,
+ 79,
{
"universalIdentifier": [
1,
@@ -7945,10 +7950,10 @@ export default {
}
],
"findManyApplicationRegistrations": [
- 78
+ 79
],
"findOneApplicationRegistration": [
- 78,
+ 79,
{
"id": [
1,
@@ -7957,7 +7962,7 @@ export default {
}
],
"findApplicationRegistrationStats": [
- 210,
+ 211,
{
"id": [
1,
@@ -7966,7 +7971,7 @@ export default {
}
],
"findApplicationRegistrationVariables": [
- 208,
+ 209,
{
"applicationRegistrationId": [
1,
@@ -7984,7 +7989,7 @@ export default {
}
],
"findClaimableApplicationRegistration": [
- 235,
+ 236,
{
"sourcePackage": [
1
@@ -8004,10 +8009,10 @@ export default {
}
],
"findManyApplications": [
- 51
+ 52
],
"findOneApplication": [
- 51,
+ 52,
{
"id": [
3
@@ -8018,7 +8023,7 @@ export default {
}
],
"findInstallApplicationJobStatus": [
- 174,
+ 175,
{
"universalIdentifier": [
1,
@@ -8027,7 +8032,7 @@ export default {
}
],
"findUninstallApplicationJobStatus": [
- 174,
+ 175,
{
"universalIdentifier": [
1,
@@ -8036,7 +8041,7 @@ export default {
}
],
"findManyMarketplaceApps": [
- 253,
+ 254,
{
"universalIdentifiers": [
1,
@@ -8045,7 +8050,7 @@ export default {
}
],
"findMarketplaceAppDetail": [
- 257,
+ 258,
{
"universalIdentifier": [
1,
@@ -8054,7 +8059,7 @@ export default {
}
],
"publicMarketplaceApps": [
- 253,
+ 254,
{
"isVetted": [
8,
@@ -8063,7 +8068,7 @@ export default {
}
],
"publicMarketplaceAppDetail": [
- 257,
+ 258,
{
"universalIdentifier": [
1,
@@ -8072,20 +8077,20 @@ export default {
}
],
"fields": [
- 268,
+ 269,
{
"paging": [
- 29,
+ 30,
"CursorPaging!"
],
"filter": [
- 32,
+ 33,
"FieldFilter!"
]
}
],
"field": [
- 264,
+ 265,
{
"id": [
3,
@@ -8094,7 +8099,7 @@ export default {
}
],
"getViewGroups": [
- 61,
+ 62,
{
"viewId": [
1
@@ -8102,7 +8107,7 @@ export default {
}
],
"getViewGroup": [
- 61,
+ 62,
{
"id": [
1,
@@ -8111,28 +8116,28 @@ export default {
}
],
"previewMessageCampaignAudience": [
- 342,
+ 343,
{
"input": [
- 428,
+ 429,
"PreviewMessageCampaignAudienceInput!"
]
}
],
"messageSuppressions": [
- 350,
+ 351,
{
"input": [
- 429,
+ 430,
"FindMessageSuppressionsInput!"
]
}
],
"unsubscribeTopics": [
- 351
+ 352
],
"myMessageChannels": [
- 331,
+ 332,
{
"connectedAccountId": [
3
@@ -8140,18 +8145,18 @@ export default {
}
],
"appMessageChannels": [
- 331,
+ 332,
{
"filter": [
- 430
+ 431
]
}
],
"getEmailingDomains": [
- 327
+ 328
],
"getToolIndex": [
- 363
+ 364
],
"getToolInputSchema": [
9,
@@ -8163,10 +8168,10 @@ export default {
}
],
"webhooks": [
- 362
+ 363
],
"webhook": [
- 362,
+ 363,
{
"id": [
3,
@@ -8175,7 +8180,7 @@ export default {
}
],
"myMessageFolders": [
- 406,
+ 407,
{
"messageChannelId": [
3
@@ -8183,7 +8188,7 @@ export default {
}
],
"myCalendarChannels": [
- 401,
+ 402,
{
"connectedAccountId": [
3
@@ -8191,25 +8196,25 @@ export default {
}
],
"getPermissionFlags": [
- 414
+ 415
],
"minimalMetadata": [
- 419
+ 420
],
"appKeyValue": [
- 399,
+ 400,
{
"key": [
1,
"String!"
],
"scope": [
- 400
+ 401
]
}
],
"getJobs": [
- 174,
+ 175,
{
"jobIds": [
1,
@@ -8218,30 +8223,30 @@ export default {
}
],
"appConnections": [
- 239,
+ 240,
{
"filter": [
- 431
+ 432
]
}
],
"appConnection": [
- 239,
+ 240,
{
"id": [
- 170,
+ 171,
"ID!"
]
}
],
"findWorkspaceAiStats": [
- 396
+ 397
],
"aiChatUsage": [
- 375
+ 376
],
"chatThread": [
- 377,
+ 378,
{
"id": [
3,
@@ -8250,7 +8255,7 @@ export default {
}
],
"chatMessages": [
- 361,
+ 362,
{
"threadId": [
3,
@@ -8259,7 +8264,7 @@ export default {
}
],
"chatStreamCatchupChunks": [
- 381,
+ 382,
{
"threadId": [
3,
@@ -8268,13 +8273,13 @@ export default {
}
],
"getAiSystemPromptPreview": [
- 379
+ 380
],
"skills": [
- 376
+ 377
],
"skill": [
- 376,
+ 377,
{
"id": [
3,
@@ -8283,7 +8288,7 @@ export default {
}
],
"agentTurns": [
- 395,
+ 396,
{
"agentId": [
3,
@@ -8292,7 +8297,7 @@ export default {
}
],
"validationRules": [
- 413,
+ 414,
{
"objectMetadataId": [
3,
@@ -8301,28 +8306,28 @@ export default {
}
],
"timelineActivityTypes": [
- 412
+ 413
],
"metadataTranslations": [
- 408,
+ 409,
{
"input": [
- 432,
+ 433,
"MetadataTranslationsInput!"
]
}
],
"recordPermissions": [
- 393,
+ 394,
{
"targets": [
- 433,
+ 434,
"[RecordPermissionsTargetInput!]!"
]
}
],
"checkUserExists": [
- 306,
+ 307,
{
"email": [
1,
@@ -8334,7 +8339,7 @@ export default {
}
],
"checkWorkspaceInviteHashIsValid": [
- 307,
+ 308,
{
"inviteHash": [
1,
@@ -8343,7 +8348,7 @@ export default {
}
],
"findWorkspaceFromInviteHash": [
- 71,
+ 72,
{
"inviteHash": [
1,
@@ -8352,7 +8357,7 @@ export default {
}
],
"checkWorkspaceSubdomainAvailability": [
- 301,
+ 302,
{
"subdomain": [
1,
@@ -8361,10 +8366,10 @@ export default {
}
],
"getWorkspaceCreationDefaults": [
- 302
+ 303
],
"validatePasswordResetToken": [
- 299,
+ 300,
{
"passwordResetToken": [
1,
@@ -8373,43 +8378,43 @@ export default {
}
],
"currentUser": [
- 75
+ 76
],
"getSSOIdentityProviders": [
- 244
+ 245
],
"eventLogs": [
- 391,
+ 392,
{
"input": [
- 434,
+ 435,
"EventLogQueryInput!"
]
}
],
"pieChartData": [
- 373,
+ 374,
{
"input": [
- 440,
+ 441,
"PieChartDataInput!"
]
}
],
"lineChartData": [
- 371,
+ 372,
{
"input": [
- 441,
+ 442,
"LineChartDataInput!"
]
}
],
"barChartData": [
- 368,
+ 369,
{
"input": [
- 442,
+ 443,
"BarChartDataInput!"
]
}
@@ -8424,7 +8429,7 @@ export default {
}
],
"getConnectedImapSmtpCaldavAccount": [
- 358,
+ 359,
{
"id": [
3,
@@ -8433,7 +8438,7 @@ export default {
}
],
"getAutoCompleteAddress": [
- 353,
+ 354,
{
"address": [
1,
@@ -8452,7 +8457,7 @@ export default {
}
],
"getAddressDetails": [
- 355,
+ 356,
{
"placeId": [
1,
@@ -8465,10 +8470,10 @@ export default {
}
],
"findManyPublicDomains": [
- 325
+ 326
],
"exportApplication": [
- 315,
+ 316,
{
"universalIdentifier": [
3,
@@ -8486,7 +8491,7 @@ export default {
}
],
"currentUserApplicationAuthorizations": [
- 310
+ 311
],
"__typename": [
1
@@ -8505,10 +8510,10 @@ export default {
},
"UsageQuotaScopeInput": {
"resourceType": [
- 156
+ 157
],
"operationType": [
- 157
+ 158
],
"spenderType": [
1
@@ -8536,37 +8541,37 @@ export default {
},
"ObjectFilter": {
"and": [
- 424
+ 425
],
"or": [
- 424
+ 425
],
"id": [
- 33
+ 34
],
"universalIdentifier": [
- 33
+ 34
],
"isActive": [
- 34
+ 35
],
"isRemote": [
- 34
+ 35
],
"isSearchable": [
- 34
+ 35
],
"isSystem": [
- 34
+ 35
],
"isUICreatable": [
- 34
+ 35
],
"isUIEditable": [
- 34
+ 35
],
"isUIReadOnly": [
- 34
+ 35
],
"__typename": [
1
@@ -8574,7 +8579,7 @@ export default {
},
"LogicFunctionIdInput": {
"id": [
- 170
+ 171
],
"__typename": [
1
@@ -8591,7 +8596,7 @@ export default {
1
],
"operationTypes": [
- 157
+ 158
],
"__typename": [
1
@@ -8618,7 +8623,7 @@ export default {
},
"FindMessageSuppressionsInput": {
"reason": [
- 348
+ 349
],
"searchTerm": [
1
@@ -8627,10 +8632,10 @@ export default {
3
],
"limit": [
- 30
+ 31
],
"offset": [
- 30
+ 31
],
"__typename": [
1
@@ -8685,13 +8690,13 @@ export default {
},
"EventLogQueryInput": {
"table": [
- 435
+ 436
],
"filters": [
- 436
+ 437
],
"first": [
- 30
+ 31
],
"after": [
1
@@ -8709,7 +8714,7 @@ export default {
1
],
"dateRange": [
- 437
+ 438
],
"recordId": [
1
@@ -8718,7 +8723,7 @@ export default {
1
],
"fieldFilters": [
- 438
+ 439
],
"__typename": [
1
@@ -8740,7 +8745,7 @@ export default {
1
],
"operand": [
- 439
+ 440
],
"values": [
1
@@ -8788,7 +8793,7 @@ export default {
8,
{
"input": [
- 444,
+ 445,
"AddQuerySubscriptionInput!"
]
}
@@ -8797,20 +8802,20 @@ export default {
8,
{
"input": [
- 445,
+ 446,
"RemoveQueryFromEventStreamInput!"
]
}
],
"setRecordShare": [
- 173,
+ 174,
{
"target": [
- 421,
+ 422,
"RecordSharingTargetInput!"
],
"principal": [
- 446,
+ 447,
"RecordSharePrincipalInput!"
],
"enabled": [
@@ -8818,48 +8823,48 @@ export default {
"Boolean!"
],
"accessLevel": [
- 171
+ 172
]
}
],
"createManyNavigationMenuItems": [
- 166,
+ 167,
{
"inputs": [
- 447,
+ 448,
"[CreateNavigationMenuItemInput!]!"
]
}
],
"createNavigationMenuItem": [
- 166,
+ 167,
{
"input": [
- 447,
+ 448,
"CreateNavigationMenuItemInput!"
]
}
],
"updateManyNavigationMenuItems": [
- 166,
+ 167,
{
"inputs": [
- 448,
+ 449,
"[UpdateOneNavigationMenuItemInput!]!"
]
}
],
"updateNavigationMenuItem": [
- 166,
+ 167,
{
"input": [
- 448,
+ 449,
"UpdateOneNavigationMenuItemInput!"
]
}
],
"deleteManyNavigationMenuItems": [
- 166,
+ 167,
{
"ids": [
3,
@@ -8868,7 +8873,7 @@ export default {
}
],
"deleteNavigationMenuItem": [
- 166,
+ 167,
{
"id": [
3,
@@ -8877,7 +8882,7 @@ export default {
}
],
"createFileUpload": [
- 164,
+ 165,
{
"filename": [
1,
@@ -8888,7 +8893,7 @@ export default {
"Float!"
],
"fileFolder": [
- 320,
+ 321,
"FileFolder!"
],
"fieldMetadataId": [
@@ -8900,7 +8905,7 @@ export default {
}
],
"completeFileUpload": [
- 163,
+ 164,
{
"fileId": [
1,
@@ -8912,10 +8917,10 @@ export default {
8
],
"releaseEnterpriseServerBinding": [
- 153
+ 154
],
"setEnterpriseKey": [
- 153,
+ 154,
{
"enterpriseKey": [
1,
@@ -8924,25 +8929,25 @@ export default {
}
],
"uploadWorkspaceLogo": [
- 163,
+ 164,
{
"file": [
- 450,
+ 451,
"Upload!"
]
}
],
"uploadWorkspaceMemberProfilePicture": [
- 163,
+ 164,
{
"file": [
- 450,
+ 451,
"Upload!"
]
}
],
"completeWorkspaceLogoUpload": [
- 163,
+ 164,
{
"fileId": [
1,
@@ -8951,7 +8956,7 @@ export default {
}
],
"completeWorkspaceMemberProfilePictureUpload": [
- 163,
+ 164,
{
"fileId": [
1,
@@ -8960,10 +8965,10 @@ export default {
}
],
"uploadFilesFieldFileByUniversalIdentifier": [
- 163,
+ 164,
{
"file": [
- 450,
+ 451,
"Upload!"
],
"fieldMetadataUniversalIdentifier": [
@@ -8973,19 +8978,19 @@ export default {
}
],
"createUsageLimit": [
- 162,
+ 163,
{
"input": [
- 451,
+ 452,
"CreateUsageLimitInput!"
]
}
],
"updateUsageLimit": [
- 162,
+ 163,
{
"input": [
- 452,
+ 453,
"UpdateUsageLimitInput!"
]
}
@@ -9000,23 +9005,23 @@ export default {
}
],
"createPageLayoutWidget": [
- 100,
+ 101,
{
"input": [
- 453,
+ 454,
"CreatePageLayoutWidgetInput!"
]
}
],
"updatePageLayoutWidget": [
- 100,
+ 101,
{
"id": [
1,
"String!"
],
"input": [
- 454,
+ 455,
"UpdatePageLayoutWidgetInput!"
]
}
@@ -9031,23 +9036,23 @@ export default {
}
],
"createPageLayoutTab": [
- 146,
+ 147,
{
"input": [
- 455,
+ 456,
"CreatePageLayoutTabInput!"
]
}
],
"updatePageLayoutTab": [
- 146,
+ 147,
{
"id": [
1,
"String!"
],
"input": [
- 456,
+ 457,
"UpdatePageLayoutTabInput!"
]
}
@@ -9062,23 +9067,23 @@ export default {
}
],
"createPageLayout": [
- 147,
+ 148,
{
"input": [
- 457,
+ 458,
"CreatePageLayoutInput!"
]
}
],
"updatePageLayout": [
- 147,
+ 148,
{
"id": [
1,
"String!"
],
"input": [
- 458,
+ 459,
"UpdatePageLayoutInput!"
]
}
@@ -9093,20 +9098,20 @@ export default {
}
],
"updatePageLayoutWithTabsAndWidgets": [
- 147,
+ 148,
{
"id": [
1,
"String!"
],
"input": [
- 459,
+ 460,
"UpdatePageLayoutWithTabsInput!"
]
}
],
"resetPageLayoutToDefault": [
- 147,
+ 148,
{
"id": [
1,
@@ -9115,7 +9120,7 @@ export default {
}
],
"resetPageLayoutWidgetToDefault": [
- 100,
+ 101,
{
"id": [
1,
@@ -9124,7 +9129,7 @@ export default {
}
],
"resetPageLayoutTabToDefault": [
- 146,
+ 147,
{
"id": [
1,
@@ -9133,23 +9138,23 @@ export default {
}
],
"createView": [
- 65,
+ 66,
{
"input": [
- 462,
+ 463,
"CreateViewInput!"
]
}
],
"updateView": [
- 65,
+ 66,
{
"id": [
1,
"String!"
],
"input": [
- 463,
+ 464,
"UpdateViewInput!"
]
}
@@ -9173,28 +9178,28 @@ export default {
}
],
"upsertViewWidget": [
- 65,
+ 66,
{
"input": [
- 464,
+ 465,
"UpsertViewWidgetInput!"
]
}
],
"createViewSort": [
- 62,
+ 63,
{
"input": [
- 470,
+ 471,
"CreateViewSortInput!"
]
}
],
"updateViewSort": [
- 62,
+ 63,
{
"input": [
- 471,
+ 472,
"UpdateViewSortInput!"
]
}
@@ -9203,7 +9208,7 @@ export default {
8,
{
"input": [
- 473,
+ 474,
"DeleteViewSortInput!"
]
}
@@ -9212,142 +9217,142 @@ export default {
8,
{
"input": [
- 474,
+ 475,
"DestroyViewSortInput!"
]
}
],
"createViewFilter": [
- 59,
+ 60,
{
"input": [
- 475,
+ 476,
"CreateViewFilterInput!"
]
}
],
"updateViewFilter": [
- 59,
+ 60,
{
"input": [
- 476,
+ 477,
"UpdateViewFilterInput!"
]
}
],
"deleteViewFilter": [
- 59,
+ 60,
{
"input": [
- 478,
+ 479,
"DeleteViewFilterInput!"
]
}
],
"destroyViewFilter": [
- 59,
+ 60,
{
"input": [
- 479,
+ 480,
"DestroyViewFilterInput!"
]
}
],
"updateViewField": [
- 55,
+ 56,
{
"input": [
- 480,
+ 481,
"UpdateViewFieldInput!"
]
}
],
"createViewField": [
- 55,
+ 56,
{
"input": [
- 482,
+ 483,
"CreateViewFieldInput!"
]
}
],
"createManyViewFields": [
- 55,
+ 56,
{
"inputs": [
- 482,
+ 483,
"[CreateViewFieldInput!]!"
]
}
],
"deleteViewField": [
- 55,
+ 56,
{
"input": [
- 483,
+ 484,
"DeleteViewFieldInput!"
]
}
],
"destroyViewField": [
- 55,
+ 56,
{
"input": [
- 484,
+ 485,
"DestroyViewFieldInput!"
]
}
],
"updateViewFieldGroup": [
- 64,
+ 65,
{
"input": [
- 485,
+ 486,
"UpdateViewFieldGroupInput!"
]
}
],
"createViewFieldGroup": [
- 64,
+ 65,
{
"input": [
- 487,
+ 488,
"CreateViewFieldGroupInput!"
]
}
],
"createManyViewFieldGroups": [
- 64,
+ 65,
{
"inputs": [
- 487,
+ 488,
"[CreateViewFieldGroupInput!]!"
]
}
],
"deleteViewFieldGroup": [
- 64,
+ 65,
{
"input": [
- 488,
+ 489,
"DeleteViewFieldGroupInput!"
]
}
],
"destroyViewFieldGroup": [
- 64,
+ 65,
{
"input": [
- 489,
+ 490,
"DestroyViewFieldGroupInput!"
]
}
],
"upsertFieldsWidget": [
- 65,
+ 66,
{
"input": [
- 490,
+ 491,
"UpsertFieldsWidgetInput!"
]
}
@@ -9356,7 +9361,7 @@ export default {
10,
{
"input": [
- 493,
+ 494,
"CreateAgentInput!"
]
}
@@ -9365,7 +9370,7 @@ export default {
10,
{
"input": [
- 494,
+ 495,
"UpdateAgentInput!"
]
}
@@ -9374,7 +9379,7 @@ export default {
10,
{
"input": [
- 423,
+ 424,
"AgentIdInput!"
]
}
@@ -9383,7 +9388,7 @@ export default {
25,
{
"input": [
- 495,
+ 496,
"CreateOneObjectInput!"
]
}
@@ -9392,7 +9397,7 @@ export default {
25,
{
"input": [
- 497,
+ 498,
"DeleteOneObjectInput!"
]
}
@@ -9401,7 +9406,7 @@ export default {
25,
{
"input": [
- 498,
+ 499,
"UpdateOneObjectInput!"
]
}
@@ -9410,25 +9415,25 @@ export default {
25,
{
"inputs": [
- 498,
+ 499,
"[UpdateOneObjectInput!]!"
]
}
],
"createOneIndex": [
- 272,
+ 273,
{
"input": [
- 501,
+ 502,
"CreateOneIndexInput!"
]
}
],
"deleteOneIndex": [
- 272,
+ 273,
{
"input": [
- 504,
+ 505,
"DeleteOneIndexInput!"
]
}
@@ -9443,13 +9448,13 @@ export default {
}
],
"revokeAllOtherUserSessions": [
- 30
+ 31
],
"deleteOneLogicFunction": [
23,
{
"input": [
- 425,
+ 426,
"LogicFunctionIdInput!"
]
}
@@ -9458,16 +9463,16 @@ export default {
23,
{
"input": [
- 505,
+ 506,
"CreateLogicFunctionFromSourceInput!"
]
}
],
"executeOneLogicFunction": [
- 151,
+ 152,
{
"input": [
- 506,
+ 507,
"ExecuteOneLogicFunctionInput!"
]
}
@@ -9476,7 +9481,7 @@ export default {
8,
{
"input": [
- 507,
+ 508,
"UpdateLogicFunctionFromSourceInput!"
]
}
@@ -9485,7 +9490,7 @@ export default {
14,
{
"input": [
- 509,
+ 510,
"CreateCommandMenuItemInput!"
]
}
@@ -9494,7 +9499,7 @@ export default {
14,
{
"input": [
- 510,
+ 511,
"UpdateCommandMenuItemInput!"
]
}
@@ -9530,7 +9535,7 @@ export default {
13,
{
"input": [
- 511,
+ 512,
"CreateFrontComponentInput!"
]
}
@@ -9539,7 +9544,7 @@ export default {
13,
{
"input": [
- 512,
+ 513,
"UpdateFrontComponentInput!"
]
}
@@ -9570,7 +9575,7 @@ export default {
}
],
"skipSyncEmailOnboardingStep": [
- 197,
+ 198,
{
"isAutoSkipped": [
8,
@@ -9579,7 +9584,7 @@ export default {
}
],
"completeBookCallOnboardingStep": [
- 197,
+ 198,
{
"hasBookedCall": [
8,
@@ -9592,7 +9597,7 @@ export default {
}
],
"triggerInstallAppsOnboardingStep": [
- 197,
+ 198,
{
"universalIdentifiers": [
1,
@@ -9605,17 +9610,17 @@ export default {
}
],
"goBackToPreviousOnboardingStep": [
- 196
+ 197
],
"checkoutSession": [
- 188,
+ 189,
{
"recurringInterval": [
- 86,
+ 87,
"SubscriptionInterval!"
],
"plan": [
- 82,
+ 83,
"BillingPlanKey!"
],
"requirePaymentMethod": [
@@ -9628,14 +9633,14 @@ export default {
}
],
"createSubscriptionPaymentIntent": [
- 187,
+ 188,
{
"recurringInterval": [
- 86,
+ 87,
"SubscriptionInterval!"
],
"plan": [
- 82,
+ 83,
"BillingPlanKey!"
],
"requirePaymentMethod": [
@@ -9652,22 +9657,22 @@ export default {
}
],
"createBillingPaymentMethodSetupIntent": [
- 187
+ 188
],
"switchSubscriptionInterval": [
- 189
+ 190
],
"switchBillingPlan": [
- 189
+ 190
],
"cancelSwitchBillingPlan": [
- 189
+ 190
],
"cancelSwitchBillingInterval": [
- 189
+ 190
],
"setResourceCreditSubscriptionPrice": [
- 189,
+ 190,
{
"priceId": [
1,
@@ -9676,10 +9681,10 @@ export default {
}
],
"endSubscriptionTrialPeriod": [
- 184
+ 185
],
"cancelSwitchResourceCreditPrice": [
- 189
+ 190
],
"deleteWorkspaceInvitation": [
1,
@@ -9691,7 +9696,7 @@ export default {
}
],
"resendWorkspaceInvitation": [
- 199,
+ 200,
{
"appTokenId": [
1,
@@ -9700,7 +9705,7 @@ export default {
}
],
"sendInvitations": [
- 199,
+ 200,
{
"emails": [
1,
@@ -9712,10 +9717,10 @@ export default {
}
],
"createApprovedAccessDomain": [
- 194,
+ 195,
{
"input": [
- 514,
+ 515,
"CreateApprovedAccessDomainInput!"
]
}
@@ -9724,22 +9729,22 @@ export default {
8,
{
"input": [
- 515,
+ 516,
"DeleteApprovedAccessDomainInput!"
]
}
],
"validateApprovedAccessDomain": [
- 194,
+ 195,
{
"input": [
- 516,
+ 517,
"ValidateApprovedAccessDomainInput!"
]
}
],
"updateWorkspaceMemberRole": [
- 37,
+ 38,
{
"workspaceMemberId": [
3,
@@ -9752,19 +9757,19 @@ export default {
}
],
"createOneRole": [
- 50,
+ 51,
{
"createRoleInput": [
- 517,
+ 518,
"CreateRoleInput!"
]
}
],
"updateOneRole": [
- 50,
+ 51,
{
"updateRoleInput": [
- 518,
+ 519,
"UpdateRoleInput!"
]
}
@@ -9779,37 +9784,37 @@ export default {
}
],
"upsertObjectPermissions": [
- 47,
+ 48,
{
"upsertObjectPermissionsInput": [
- 520,
+ 521,
"UpsertObjectPermissionsInput!"
]
}
],
"upsertPermissionFlags": [
- 48,
+ 49,
{
"upsertPermissionFlagsInput": [
- 522,
+ 523,
"UpsertPermissionFlagsInput!"
]
}
],
"upsertFieldPermissions": [
- 42,
+ 43,
{
"upsertFieldPermissionsInput": [
- 523,
+ 524,
"UpsertFieldPermissionsInput!"
]
}
],
"upsertRowLevelPermissionPredicates": [
- 285,
+ 286,
{
"input": [
- 525,
+ 526,
"UpsertRowLevelPermissionPredicatesInput!"
]
}
@@ -9840,7 +9845,7 @@ export default {
2,
{
"input": [
- 528,
+ 529,
"CreateApiKeyInput!"
]
}
@@ -9849,7 +9854,7 @@ export default {
2,
{
"input": [
- 529,
+ 530,
"UpdateApiKeyInput!"
]
}
@@ -9858,7 +9863,7 @@ export default {
2,
{
"input": [
- 530,
+ 531,
"RevokeApiKeyInput!"
]
}
@@ -9877,23 +9882,23 @@ export default {
}
],
"createViewFilterGroup": [
- 57,
+ 58,
{
"input": [
- 531,
+ 532,
"CreateViewFilterGroupInput!"
]
}
],
"updateViewFilterGroup": [
- 57,
+ 58,
{
"id": [
1,
"String!"
],
"input": [
- 532,
+ 533,
"UpdateViewFilterGroupInput!"
]
}
@@ -9917,7 +9922,7 @@ export default {
}
],
"deleteConnectedAccount": [
- 203,
+ 204,
{
"id": [
3,
@@ -9926,7 +9931,7 @@ export default {
}
],
"disconnectConnectedAccount": [
- 203,
+ 204,
{
"id": [
3,
@@ -9935,40 +9940,40 @@ export default {
}
],
"activateWorkspace": [
- 71,
+ 72,
{
"data": [
- 533,
+ 534,
"ActivateWorkspaceInput!"
]
}
],
"updateWorkspace": [
- 71,
+ 72,
{
"data": [
- 534,
+ 535,
"UpdateWorkspaceInput!"
]
}
],
"updateWorkspaceAllowedIframeOrigins": [
- 71,
+ 72,
{
"data": [
- 535,
+ 536,
"UpdateWorkspaceAllowedIframeOriginsInput!"
]
}
],
"deleteCurrentWorkspace": [
- 71
+ 72
],
"checkCustomDomainValidRecords": [
- 284
+ 285
],
"enrichWorkspaceCompany": [
- 261
+ 262
],
"upgradeApplication": [
8,
@@ -9984,19 +9989,19 @@ export default {
}
],
"createApplicationRegistration": [
- 236,
+ 237,
{
"input": [
- 536,
+ 537,
"CreateApplicationRegistrationInput!"
]
}
],
"updateApplicationRegistration": [
- 78,
+ 79,
{
"input": [
- 537,
+ 538,
"UpdateApplicationRegistrationInput!"
]
}
@@ -10011,7 +10016,7 @@ export default {
}
],
"rotateApplicationRegistrationClientSecret": [
- 238,
+ 239,
{
"id": [
1,
@@ -10020,16 +10025,16 @@ export default {
}
],
"updateApplicationRegistrationVariable": [
- 208,
+ 209,
{
"input": [
- 539,
+ 540,
"UpdateApplicationRegistrationVariableInput!"
]
}
],
"completeAppTarballUpload": [
- 78,
+ 79,
{
"fileId": [
3,
@@ -10038,10 +10043,10 @@ export default {
}
],
"uploadAppTarball": [
- 78,
+ 79,
{
"file": [
- 450,
+ 451,
"Upload!"
],
"universalIdentifier": [
@@ -10050,7 +10055,7 @@ export default {
}
],
"claimApplicationRegistrationOwnership": [
- 78,
+ 79,
{
"applicationRegistrationId": [
1,
@@ -10059,7 +10064,7 @@ export default {
}
],
"transferApplicationRegistrationOwnership": [
- 78,
+ 79,
{
"applicationRegistrationId": [
1,
@@ -10072,10 +10077,10 @@ export default {
}
],
"grantApplicationCapabilities": [
- 260,
+ 261,
{
"input": [
- 541,
+ 542,
"GrantApplicationCapabilitiesInput!"
]
}
@@ -10093,7 +10098,7 @@ export default {
}
],
"installApplication": [
- 51,
+ 52,
{
"universalIdentifier": [
1,
@@ -10105,32 +10110,32 @@ export default {
}
],
"triggerInstallApplicationJob": [
- 258,
+ 259,
{
"input": [
- 542,
+ 543,
"TriggerInstallApplicationJobInput!"
]
}
],
"triggerUninstallApplicationJob": [
- 259,
+ 260,
{
"input": [
- 543,
+ 544,
"TriggerUninstallApplicationJobInput!"
]
}
],
"updateApplication": [
- 51,
+ 52,
{
"id": [
3,
"UUID!"
],
"input": [
- 544,
+ 545,
"UpdateApplicationInput!"
]
}
@@ -10148,7 +10153,7 @@ export default {
8
],
"runApplicationHealthCheck": [
- 251,
+ 252,
{
"applicationId": [
3,
@@ -10157,115 +10162,115 @@ export default {
}
],
"createOneField": [
- 264,
+ 265,
{
"input": [
- 545,
+ 546,
"CreateOneFieldMetadataInput!"
]
}
],
"updateOneField": [
- 264,
+ 265,
{
"input": [
- 547,
+ 548,
"UpdateOneFieldMetadataInput!"
]
}
],
"deleteOneField": [
- 264,
+ 265,
{
"input": [
- 549,
+ 550,
"DeleteOneFieldInput!"
]
}
],
"createViewGroup": [
- 61,
+ 62,
{
"input": [
- 550,
+ 551,
"CreateViewGroupInput!"
]
}
],
"createManyViewGroups": [
- 61,
+ 62,
{
"inputs": [
- 550,
+ 551,
"[CreateViewGroupInput!]!"
]
}
],
"updateViewGroup": [
- 61,
+ 62,
{
"input": [
- 551,
+ 552,
"UpdateViewGroupInput!"
]
}
],
"updateManyViewGroups": [
- 61,
+ 62,
{
"inputs": [
- 551,
+ 552,
"[UpdateViewGroupInput!]!"
]
}
],
"deleteViewGroup": [
- 61,
+ 62,
{
"input": [
- 553,
+ 554,
"DeleteViewGroupInput!"
]
}
],
"destroyViewGroup": [
- 61,
+ 62,
{
"input": [
- 554,
+ 555,
"DestroyViewGroupInput!"
]
}
],
"sendMessageCampaign": [
- 345,
+ 346,
{
"input": [
- 555,
+ 556,
"SendMessageCampaignInput!"
]
}
],
"cancelMessageCampaign": [
- 343,
+ 344,
{
"input": [
- 556,
+ 557,
"CancelMessageCampaignInput!"
]
}
],
"sendMessageCampaignTest": [
- 344,
+ 345,
{
"input": [
- 557,
+ 558,
"SendMessageCampaignTestInput!"
]
}
],
"duplicateMessageList": [
- 346,
+ 347,
{
"id": [
3,
@@ -10274,10 +10279,10 @@ export default {
}
],
"createMessageSuppression": [
- 347,
+ 348,
{
"input": [
- 558,
+ 559,
"CreateMessageSuppressionInput!"
]
}
@@ -10292,19 +10297,19 @@ export default {
}
],
"createUnsubscribeTopic": [
- 351,
+ 352,
{
"input": [
- 559,
+ 560,
"CreateUnsubscribeTopicInput!"
]
}
],
"updateUnsubscribeTopic": [
- 351,
+ 352,
{
"input": [
- 560,
+ 561,
"UpdateUnsubscribeTopicInput!"
]
}
@@ -10319,34 +10324,34 @@ export default {
}
],
"updateMessageChannel": [
- 331,
+ 332,
{
"input": [
- 561,
+ 562,
"UpdateMessageChannelInput!"
]
}
],
"createEmailGroupChannel": [
- 341,
+ 342,
{
"input": [
- 563,
+ 564,
"CreateEmailGroupChannelInput!"
]
}
],
"updateEmailGroupChannel": [
- 331,
+ 332,
{
"input": [
- 564,
+ 565,
"UpdateEmailGroupChannelInput!"
]
}
],
"deleteEmailGroupChannel": [
- 331,
+ 332,
{
"id": [
3,
@@ -10355,25 +10360,25 @@ export default {
}
],
"createAppMessageChannel": [
- 331,
+ 332,
{
"input": [
- 565,
+ 566,
"CreateAppMessageChannelInput!"
]
}
],
"updateAppMessageChannel": [
- 331,
+ 332,
{
"input": [
- 566,
+ 567,
"UpdateAppMessageChannelInput!"
]
}
],
"deleteAppMessageChannel": [
- 331,
+ 332,
{
"id": [
3,
@@ -10382,19 +10387,19 @@ export default {
}
],
"ingestAppMessages": [
- 340,
+ 341,
{
"input": [
- 567,
+ 568,
"IngestAppMessagesInput!"
]
}
],
"createEmailingDomain": [
- 327,
+ 328,
{
"input": [
- 571,
+ 572,
"CreateEmailingDomainInput!"
]
}
@@ -10409,7 +10414,7 @@ export default {
}
],
"verifyEmailingDomain": [
- 327,
+ 328,
{
"id": [
1,
@@ -10418,34 +10423,34 @@ export default {
}
],
"runAgent": [
- 364,
+ 365,
{
"input": [
- 572,
+ 573,
"RunAgentInput!"
]
}
],
"createWebhook": [
- 362,
+ 363,
{
"input": [
- 576,
+ 577,
"CreateWebhookInput!"
]
}
],
"updateWebhook": [
- 362,
+ 363,
{
"input": [
- 577,
+ 578,
"UpdateWebhookInput!"
]
}
],
"deleteWebhook": [
- 362,
+ 363,
{
"id": [
3,
@@ -10454,37 +10459,37 @@ export default {
}
],
"updateMessageFolder": [
- 406,
+ 407,
{
"input": [
- 579,
+ 580,
"UpdateMessageFolderInput!"
]
}
],
"updateMessageFolders": [
- 406,
+ 407,
{
"input": [
- 581,
+ 582,
"UpdateMessageFoldersInput!"
]
}
],
"updateCalendarChannel": [
- 401,
+ 402,
{
"input": [
- 582,
+ 583,
"UpdateCalendarChannelInput!"
]
}
],
"setAppKeyValue": [
- 399,
+ 400,
{
"input": [
- 584,
+ 585,
"SetAppKeyValueInput!"
]
}
@@ -10497,24 +10502,24 @@ export default {
"String!"
],
"scope": [
- 400
+ 401
]
}
],
"enqueueJob": [
- 397,
+ 398,
{
"input": [
- 585,
+ 586,
"EnqueueJobInput!"
]
}
],
"enqueueJobs": [
- 398,
+ 399,
{
"input": [
- 586,
+ 587,
"EnqueueJobsInput!"
]
}
@@ -10523,16 +10528,16 @@ export default {
8,
{
"input": [
- 588,
+ 589,
"ReportAppConnectionAuthFailureInput!"
]
}
],
"createChatThread": [
- 377
+ 378
],
"sendChatMessage": [
- 382,
+ 383,
{
"threadId": [
3,
@@ -10553,13 +10558,13 @@ export default {
1
],
"fileAttachments": [
- 589,
+ 590,
"[FileAttachmentInput!]"
]
}
],
"retryChatMessage": [
- 382,
+ 383,
{
"threadId": [
3,
@@ -10589,7 +10594,7 @@ export default {
}
],
"startWorkspaceSetupChat": [
- 385,
+ 386,
{
"companyContext": [
9
@@ -10600,34 +10605,34 @@ export default {
}
],
"sendInboxMessage": [
- 384,
+ 385,
{
"input": [
- 590,
+ 591,
"SendInboxMessageInput!"
]
}
],
"createSkill": [
- 376,
+ 377,
{
"input": [
- 591,
+ 592,
"CreateSkillInput!"
]
}
],
"updateSkill": [
- 376,
+ 377,
{
"input": [
- 592,
+ 593,
"UpdateSkillInput!"
]
}
],
"deleteSkill": [
- 376,
+ 377,
{
"id": [
3,
@@ -10636,7 +10641,7 @@ export default {
}
],
"activateSkill": [
- 376,
+ 377,
{
"id": [
3,
@@ -10645,7 +10650,7 @@ export default {
}
],
"deactivateSkill": [
- 376,
+ 377,
{
"id": [
3,
@@ -10654,7 +10659,7 @@ export default {
}
],
"evaluateAgentTurn": [
- 394,
+ 395,
{
"turnId": [
3,
@@ -10663,7 +10668,7 @@ export default {
}
],
"runEvaluationInput": [
- 395,
+ 396,
{
"agentId": [
3,
@@ -10676,25 +10681,25 @@ export default {
}
],
"createValidationRule": [
- 413,
+ 414,
{
"input": [
- 593,
+ 594,
"CreateValidationRuleInput!"
]
}
],
"updateValidationRule": [
- 413,
+ 414,
{
"input": [
- 594,
+ 595,
"UpdateValidationRuleInput!"
]
}
],
"deleteValidationRule": [
- 413,
+ 414,
{
"id": [
3,
@@ -10703,16 +10708,16 @@ export default {
}
],
"updateTimelineActivityType": [
- 412,
+ 413,
{
"input": [
- 596,
+ 597,
"UpdateTimelineActivityTypeInput!"
]
}
],
"resetTimelineActivityType": [
- 412,
+ 413,
{
"id": [
3,
@@ -10721,16 +10726,16 @@ export default {
}
],
"getAuthorizationUrlForSSO": [
- 294,
+ 295,
{
"input": [
- 597,
+ 598,
"GetAuthorizationUrlForSSOInput!"
]
}
],
"getLoginTokenFromCredentials": [
- 305,
+ 306,
{
"email": [
1,
@@ -10756,7 +10761,7 @@ export default {
}
],
"signIn": [
- 292,
+ 293,
{
"email": [
1,
@@ -10778,7 +10783,7 @@ export default {
}
],
"verifyEmailAndGetLoginToken": [
- 300,
+ 301,
{
"emailVerificationToken": [
1,
@@ -10798,7 +10803,7 @@ export default {
}
],
"verifyEmailAndGetWorkspaceAgnosticToken": [
- 292,
+ 293,
{
"emailVerificationToken": [
1,
@@ -10814,7 +10819,7 @@ export default {
}
],
"getAuthTokensFromOTP": [
- 304,
+ 305,
{
"otp": [
1,
@@ -10834,7 +10839,7 @@ export default {
}
],
"signUp": [
- 292,
+ 293,
{
"email": [
1,
@@ -10856,7 +10861,7 @@ export default {
}
],
"signUpInWorkspace": [
- 297,
+ 298,
{
"email": [
1,
@@ -10887,28 +10892,28 @@ export default {
}
],
"signUpInNewWorkspace": [
- 297,
+ 298,
{
"input": [
- 598
+ 599
]
}
],
"uploadNewWorkspaceLogo": [
- 163,
+ 164,
{
"workspaceId": [
1,
"String!"
],
"file": [
- 450,
+ 451,
"Upload!"
]
}
],
"createNewWorkspaceLogoUpload": [
- 164,
+ 165,
{
"workspaceId": [
1,
@@ -10925,7 +10930,7 @@ export default {
}
],
"completeNewWorkspaceLogoUpload": [
- 163,
+ 164,
{
"workspaceId": [
1,
@@ -10938,10 +10943,10 @@ export default {
}
],
"generateTransientToken": [
- 298
+ 299
],
"getAuthTokensFromLoginToken": [
- 304,
+ 305,
{
"loginToken": [
1,
@@ -10954,7 +10959,7 @@ export default {
}
],
"getAuthTokensFromSSOExchangeToken": [
- 304,
+ 305,
{
"ssoExchangeToken": [
1,
@@ -10963,7 +10968,7 @@ export default {
}
],
"authorizeApp": [
- 290,
+ 291,
{
"clientId": [
1,
@@ -10988,7 +10993,7 @@ export default {
}
],
"renewToken": [
- 304,
+ 305,
{
"appToken": [
1,
@@ -11005,7 +11010,7 @@ export default {
}
],
"generateApiKeyToken": [
- 303,
+ 304,
{
"apiKeyId": [
3,
@@ -11021,7 +11026,7 @@ export default {
11
],
"emailPasswordResetLink": [
- 293,
+ 294,
{
"email": [
1,
@@ -11036,7 +11041,7 @@ export default {
}
],
"updatePasswordViaResetToken": [
- 295,
+ 296,
{
"passwordResetToken": [
1,
@@ -11049,7 +11054,7 @@ export default {
}
],
"initiateOTPProvisioning": [
- 288,
+ 289,
{
"loginToken": [
1,
@@ -11062,10 +11067,10 @@ export default {
}
],
"initiateOTPProvisioningForAuthenticatedUser": [
- 288
+ 289
],
"deleteTwoFactorAuthenticationMethod": [
- 287,
+ 288,
{
"twoFactorAuthenticationMethodId": [
3,
@@ -11074,7 +11079,7 @@ export default {
}
],
"verifyTwoFactorAuthenticationMethodForAuthenticatedUser": [
- 289,
+ 290,
{
"otp": [
1,
@@ -11083,10 +11088,10 @@ export default {
}
],
"deleteUser": [
- 75
+ 76
],
"deleteUserFromWorkspace": [
- 53,
+ 54,
{
"workspaceMemberIdToDelete": [
1,
@@ -11098,7 +11103,7 @@ export default {
8,
{
"input": [
- 599,
+ 600,
"UpdateWorkspaceMemberSettingsInput!"
]
}
@@ -11116,7 +11121,7 @@ export default {
}
],
"resendEmailVerificationToken": [
- 240,
+ 241,
{
"email": [
1,
@@ -11129,43 +11134,43 @@ export default {
}
],
"createOIDCIdentityProvider": [
- 245,
+ 246,
{
"input": [
- 600,
+ 601,
"SetupOIDCSsoInput!"
]
}
],
"createSAMLIdentityProvider": [
- 245,
+ 246,
{
"input": [
- 601,
+ 602,
"SetupSAMLSsoInput!"
]
}
],
"deleteSSOIdentityProvider": [
- 241,
+ 242,
{
"input": [
- 602,
+ 603,
"DeleteSsoInput!"
]
}
],
"editSSOIdentityProvider": [
- 242,
+ 243,
{
"input": [
- 603,
+ 604,
"EditSsoInput!"
]
}
],
"createObjectEvent": [
- 388,
+ 389,
{
"event": [
1,
@@ -11185,10 +11190,10 @@ export default {
}
],
"trackAnalytics": [
- 388,
+ 389,
{
"type": [
- 604,
+ 605,
"AnalyticsType!"
],
"name": [
@@ -11203,7 +11208,7 @@ export default {
}
],
"duplicateDashboard": [
- 374,
+ 375,
{
"id": [
3,
@@ -11212,7 +11217,7 @@ export default {
}
],
"impersonate": [
- 308,
+ 309,
{
"userId": [
3,
@@ -11225,28 +11230,28 @@ export default {
}
],
"stopImpersonation": [
- 309
+ 310
],
"createCalendarEvent": [
- 366,
+ 367,
{
"input": [
- 605,
+ 606,
"CreateCalendarEventInput!"
]
}
],
"sendEmail": [
- 387,
+ 388,
{
"input": [
- 606,
+ 607,
"SendEmailInput!"
]
}
],
"startChannelSync": [
- 365,
+ 366,
{
"connectedAccountId": [
3,
@@ -11255,14 +11260,14 @@ export default {
}
],
"saveImapSmtpCaldavAccount": [
- 359,
+ 360,
{
"handle": [
1,
"String!"
],
"connectionParameters": [
- 608,
+ 609,
"EmailAccountConnectionParameters!"
],
"id": [
@@ -11271,16 +11276,16 @@ export default {
}
],
"updateLabPublicFeatureFlag": [
- 205,
+ 206,
{
"input": [
- 610,
+ 611,
"UpdateLabPublicFeatureFlagInput!"
]
}
],
"createPublicDomain": [
- 325,
+ 326,
{
"domain": [
1,
@@ -11302,7 +11307,7 @@ export default {
}
],
"checkPublicDomainValidRecords": [
- 284,
+ 285,
{
"domain": [
1,
@@ -11311,7 +11316,7 @@ export default {
}
],
"createDevelopmentApplication": [
- 323,
+ 324,
{
"universalIdentifier": [
1,
@@ -11324,7 +11329,7 @@ export default {
}
],
"syncApplication": [
- 324,
+ 325,
{
"manifest": [
9,
@@ -11339,10 +11344,10 @@ export default {
}
],
"uploadApplicationFile": [
- 316,
+ 317,
{
"file": [
- 450,
+ 451,
"Upload!"
],
"applicationUniversalIdentifier": [
@@ -11350,7 +11355,7 @@ export default {
"String!"
],
"fileFolder": [
- 320,
+ 321,
"FileFolder!"
],
"filePath": [
@@ -11360,20 +11365,20 @@ export default {
}
],
"createApplicationFileUploads": [
- 322,
+ 323,
{
"applicationUniversalIdentifier": [
1,
"String!"
],
"files": [
- 611,
+ 612,
"[ApplicationFileUploadRequestInput!]!"
]
}
],
"completeApplicationFileUploads": [
- 318,
+ 319,
{
"applicationUniversalIdentifier": [
1,
@@ -11463,7 +11468,7 @@ export default {
3
],
"type": [
- 167
+ 168
],
"name": [
1
@@ -11495,7 +11500,7 @@ export default {
3
],
"update": [
- 449
+ 450
],
"__typename": [
1
@@ -11530,10 +11535,10 @@ export default {
"Upload": {},
"CreateUsageLimitInput": {
"resourceType": [
- 156
+ 157
],
"operationType": [
- 157
+ 158
],
"spenderType": [
1
@@ -11545,7 +11550,7 @@ export default {
1
],
"periodCount": [
- 30
+ 31
],
"periodUnit": [
1
@@ -11554,10 +11559,10 @@ export default {
1
],
"limitValue": [
- 160
+ 161
],
"burstValue": [
- 160
+ 161
],
"__typename": [
1
@@ -11568,7 +11573,7 @@ export default {
3
],
"payload": [
- 451
+ 452
],
"__typename": [
1
@@ -11582,7 +11587,7 @@ export default {
1
],
"type": [
- 101
+ 102
],
"objectMetadataId": [
3
@@ -11605,7 +11610,7 @@ export default {
1
],
"type": [
- 101
+ 102
],
"objectMetadataId": [
3
@@ -11637,7 +11642,7 @@ export default {
3
],
"layoutMode": [
- 104
+ 105
],
"__typename": [
1
@@ -11654,7 +11659,7 @@ export default {
1
],
"layoutMode": [
- 104
+ 105
],
"__typename": [
1
@@ -11665,7 +11670,7 @@ export default {
1
],
"type": [
- 148
+ 149
],
"objectMetadataId": [
3
@@ -11679,7 +11684,7 @@ export default {
1
],
"type": [
- 148
+ 149
],
"objectMetadataId": [
3
@@ -11693,7 +11698,7 @@ export default {
1
],
"type": [
- 148
+ 149
],
"objectMetadataId": [
3
@@ -11702,7 +11707,7 @@ export default {
8
],
"tabs": [
- 460
+ 461
],
"__typename": [
1
@@ -11722,10 +11727,10 @@ export default {
1
],
"layoutMode": [
- 104
+ 105
],
"widgets": [
- 461
+ 462
],
"__typename": [
1
@@ -11742,7 +11747,7 @@ export default {
1
],
"type": [
- 101
+ 102
],
"objectMetadataId": [
3
@@ -11774,10 +11779,10 @@ export default {
3
],
"type": [
- 66
+ 67
],
"key": [
- 67
+ 68
],
"icon": [
1
@@ -11792,16 +11797,16 @@ export default {
8
],
"kanbanColumnWidth": [
- 30
+ 31
],
"groupLoadLimit": [
- 30
+ 31
],
"openRecordIn": [
- 68
+ 69
],
"kanbanAggregateOperation": [
- 56
+ 57
],
"kanbanAggregateOperationFieldMetadataId": [
3
@@ -11810,7 +11815,7 @@ export default {
1
],
"calendarLayout": [
- 69
+ 70
],
"calendarFieldMetadataId": [
3
@@ -11822,7 +11827,7 @@ export default {
3
],
"visibility": [
- 70
+ 71
],
"__typename": [
1
@@ -11836,7 +11841,7 @@ export default {
1
],
"type": [
- 66
+ 67
],
"icon": [
1
@@ -11848,10 +11853,10 @@ export default {
8
],
"openRecordIn": [
- 68
+ 69
],
"kanbanAggregateOperation": [
- 56
+ 57
],
"kanbanAggregateOperationFieldMetadataId": [
3
@@ -11860,7 +11865,7 @@ export default {
1
],
"calendarLayout": [
- 69
+ 70
],
"calendarFieldMetadataId": [
3
@@ -11869,7 +11874,7 @@ export default {
3
],
"visibility": [
- 70
+ 71
],
"mainGroupByFieldMetadataId": [
3
@@ -11878,10 +11883,10 @@ export default {
8
],
"kanbanColumnWidth": [
- 30
+ 31
],
"groupLoadLimit": [
- 30
+ 31
],
"__typename": [
1
@@ -11892,19 +11897,19 @@ export default {
3
],
"view": [
- 465
+ 466
],
"viewFields": [
- 466
+ 467
],
"viewFilters": [
- 467
+ 468
],
"viewFilterGroups": [
- 468
+ 469
],
"viewSorts": [
- 469
+ 470
],
"__typename": [
1
@@ -11912,7 +11917,7 @@ export default {
},
"UpsertViewWidgetViewSettingsInput": {
"type": [
- 66
+ 67
],
"mainGroupByFieldMetadataId": [
3
@@ -11921,19 +11926,19 @@ export default {
8
],
"openRecordIn": [
- 68
+ 69
],
"kanbanAggregateOperation": [
- 56
+ 57
],
"kanbanAggregateOperationFieldMetadataId": [
3
],
"kanbanColumnWidth": [
- 30
+ 31
],
"calendarLayout": [
- 69
+ 70
],
"calendarFieldMetadataId": [
3
@@ -11962,7 +11967,7 @@ export default {
15
],
"aggregateOperation": [
- 56
+ 57
],
"__typename": [
1
@@ -11976,7 +11981,7 @@ export default {
3
],
"operand": [
- 60
+ 61
],
"value": [
9
@@ -12005,7 +12010,7 @@ export default {
3
],
"logicalOperator": [
- 58
+ 59
],
"positionInViewFilterGroup": [
15
@@ -12022,7 +12027,7 @@ export default {
3
],
"direction": [
- 63
+ 64
],
"__typename": [
1
@@ -12036,7 +12041,7 @@ export default {
3
],
"direction": [
- 63
+ 64
],
"subFieldName": [
1
@@ -12053,7 +12058,7 @@ export default {
3
],
"update": [
- 472
+ 473
],
"__typename": [
1
@@ -12061,7 +12066,7 @@ export default {
},
"UpdateViewSortInputUpdates": {
"direction": [
- 63
+ 64
],
"subFieldName": [
1
@@ -12094,7 +12099,7 @@ export default {
3
],
"operand": [
- 60
+ 61
],
"value": [
9
@@ -12123,7 +12128,7 @@ export default {
3
],
"update": [
- 477
+ 478
],
"__typename": [
1
@@ -12134,7 +12139,7 @@ export default {
3
],
"operand": [
- 60
+ 61
],
"value": [
9
@@ -12176,7 +12181,7 @@ export default {
3
],
"update": [
- 481
+ 482
],
"__typename": [
1
@@ -12193,7 +12198,7 @@ export default {
15
],
"aggregateOperation": [
- 56
+ 57
],
"viewFieldGroupId": [
3
@@ -12222,7 +12227,7 @@ export default {
15
],
"aggregateOperation": [
- 56
+ 57
],
"viewFieldGroupId": [
3
@@ -12252,7 +12257,7 @@ export default {
3
],
"update": [
- 486
+ 487
],
"__typename": [
1
@@ -12316,10 +12321,10 @@ export default {
3
],
"groups": [
- 491
+ 492
],
"fields": [
- 492
+ 493
],
"__typename": [
1
@@ -12339,7 +12344,7 @@ export default {
8
],
"fields": [
- 492
+ 493
],
"__typename": [
1
@@ -12437,7 +12442,7 @@ export default {
},
"CreateOneObjectInput": {
"object": [
- 496
+ 497
],
"__typename": [
1
@@ -12497,7 +12502,7 @@ export default {
},
"UpdateOneObjectInput": {
"update": [
- 499
+ 500
],
"id": [
3
@@ -12552,8 +12557,11 @@ export default {
"readability": [
27
],
+ "sharingReach": [
+ 28
+ ],
"translations": [
- 500
+ 501
],
"__typename": [
1
@@ -12575,7 +12583,7 @@ export default {
},
"CreateOneIndexInput": {
"index": [
- 502
+ 503
],
"__typename": [
1
@@ -12586,10 +12594,10 @@ export default {
3
],
"fields": [
- 503
+ 504
],
"indexType": [
- 273
+ 274
],
"__typename": [
1
@@ -12671,7 +12679,7 @@ export default {
3
],
"update": [
- 508
+ 509
],
"__typename": [
1
@@ -12840,7 +12848,7 @@ export default {
3
],
"update": [
- 513
+ 514
],
"__typename": [
1
@@ -12933,7 +12941,7 @@ export default {
},
"UpdateRoleInput": {
"update": [
- 519
+ 520
],
"id": [
3
@@ -12988,7 +12996,7 @@ export default {
3
],
"objectPermissions": [
- 521
+ 522
],
"__typename": [
1
@@ -13030,7 +13038,7 @@ export default {
3
],
"fieldPermissions": [
- 524
+ 525
],
"__typename": [
1
@@ -13061,10 +13069,10 @@ export default {
3
],
"predicates": [
- 526
+ 527
],
"predicateGroups": [
- 527
+ 528
],
"__typename": [
1
@@ -13078,7 +13086,7 @@ export default {
3
],
"operand": [
- 46
+ 47
],
"value": [
9
@@ -13113,7 +13121,7 @@ export default {
3
],
"logicalOperator": [
- 44
+ 45
],
"positionInRowLevelPermissionPredicateGroup": [
15
@@ -13172,7 +13180,7 @@ export default {
3
],
"logicalOperator": [
- 58
+ 59
],
"positionInViewFilterGroup": [
15
@@ -13192,7 +13200,7 @@ export default {
3
],
"logicalOperator": [
- 58
+ 59
],
"positionInViewFilterGroup": [
15
@@ -13235,7 +13243,7 @@ export default {
8
],
"workspaceDiscoverability": [
- 72
+ 73
],
"allowImpersonation": [
8
@@ -13271,10 +13279,10 @@ export default {
15
],
"aiChatModelTier": [
- 74
+ 75
],
"aiAgentModelTier": [
- 74
+ 75
],
"isAutoModelSelectionEnabled": [
8
@@ -13331,7 +13339,7 @@ export default {
1
],
"update": [
- 538
+ 539
],
"__typename": [
1
@@ -13356,7 +13364,7 @@ export default {
1
],
"update": [
- 540
+ 541
],
"__typename": [
1
@@ -13413,7 +13421,7 @@ export default {
},
"CreateOneFieldMetadataInput": {
"field": [
- 546
+ 547
],
"__typename": [
1
@@ -13421,7 +13429,7 @@ export default {
},
"CreateFieldInput": {
"type": [
- 265
+ 266
],
"name": [
1
@@ -13492,7 +13500,7 @@ export default {
3
],
"update": [
- 548
+ 549
],
"__typename": [
1
@@ -13557,7 +13565,7 @@ export default {
9
],
"translations": [
- 500
+ 501
],
"__typename": [
1
@@ -13596,7 +13604,7 @@ export default {
3
],
"update": [
- 552
+ 553
],
"__typename": [
1
@@ -13693,7 +13701,7 @@ export default {
1
],
"visibility": [
- 352
+ 353
],
"__typename": [
1
@@ -13710,7 +13718,7 @@ export default {
1
],
"visibility": [
- 352
+ 353
],
"__typename": [
1
@@ -13721,7 +13729,7 @@ export default {
3
],
"update": [
- 562
+ 563
],
"__typename": [
1
@@ -13729,16 +13737,16 @@ export default {
},
"UpdateMessageChannelInputUpdates": {
"visibility": [
- 332
+ 333
],
"isContactAutoCreationEnabled": [
8
],
"contactAutoCreationPolicy": [
- 334
+ 335
],
"messageFolderImportPolicy": [
- 335
+ 336
],
"isSyncEnabled": [
8
@@ -13786,7 +13794,7 @@ export default {
1
],
"visibility": [
- 332
+ 333
],
"__typename": [
1
@@ -13800,7 +13808,7 @@ export default {
1
],
"visibility": [
- 332
+ 333
],
"isSyncEnabled": [
8
@@ -13814,7 +13822,7 @@ export default {
3
],
"messages": [
- 568
+ 569
],
"__typename": [
1
@@ -13837,7 +13845,7 @@ export default {
4
],
"participants": [
- 569
+ 570
],
"__typename": [
1
@@ -13845,7 +13853,7 @@ export default {
},
"AppMessageParticipantInput": {
"role": [
- 570
+ 571
],
"handle": [
1
@@ -13883,7 +13891,7 @@ export default {
3
],
"messages": [
- 573
+ 574
],
"__typename": [
1
@@ -13891,13 +13899,13 @@ export default {
},
"RunAgentMessageInput": {
"role": [
- 574
+ 575
],
"content": [
1
],
"attachments": [
- 575
+ 576
],
"__typename": [
1
@@ -13940,7 +13948,7 @@ export default {
3
],
"update": [
- 578
+ 579
],
"__typename": [
1
@@ -13968,7 +13976,7 @@ export default {
3
],
"update": [
- 580
+ 581
],
"__typename": [
1
@@ -13987,7 +13995,7 @@ export default {
3
],
"update": [
- 580
+ 581
],
"__typename": [
1
@@ -13998,7 +14006,7 @@ export default {
3
],
"update": [
- 583
+ 584
],
"__typename": [
1
@@ -14006,13 +14014,13 @@ export default {
},
"UpdateCalendarChannelInputUpdates": {
"visibility": [
- 404
+ 405
],
"isContactAutoCreationEnabled": [
8
],
"contactAutoCreationPolicy": [
- 405
+ 406
],
"isSyncEnabled": [
8
@@ -14029,7 +14037,7 @@ export default {
9
],
"scope": [
- 400
+ 401
],
"__typename": [
1
@@ -14046,10 +14054,10 @@ export default {
1
],
"retryLimit": [
- 30
+ 31
],
"delayMs": [
- 30
+ 31
],
"__typename": [
1
@@ -14063,13 +14071,13 @@ export default {
9
],
"jobs": [
- 587
+ 588
],
"retryLimit": [
- 30
+ 31
],
"delayMs": [
- 30
+ 31
],
"__typename": [
1
@@ -14088,7 +14096,7 @@ export default {
},
"ReportAppConnectionAuthFailureInput": {
"id": [
- 170
+ 171
],
"reason": [
1
@@ -14214,7 +14222,7 @@ export default {
3
],
"update": [
- 595
+ 596
],
"__typename": [
1
@@ -14260,7 +14268,7 @@ export default {
8
],
"translations": [
- 500
+ 501
],
"__typename": [
1
@@ -14352,7 +14360,7 @@ export default {
3
],
"status": [
- 214
+ 215
],
"__typename": [
1
@@ -14426,7 +14434,7 @@ export default {
1
],
"files": [
- 607
+ 608
],
"__typename": [
1
@@ -14448,13 +14456,13 @@ export default {
1
],
"IMAP": [
- 609
+ 610
],
"SMTP": [
- 609
+ 610
],
"CALDAV": [
- 609
+ 610
],
"__typename": [
1
@@ -14474,7 +14482,7 @@ export default {
1
],
"connectionSecurity": [
- 201
+ 202
],
"__typename": [
1
@@ -14493,13 +14501,13 @@ export default {
},
"ApplicationFileUploadRequestInput": {
"fileFolder": [
- 320
+ 321
],
"filePath": [
1
],
"size": [
- 30
+ 31
],
"__typename": [
1
@@ -14507,7 +14515,7 @@ export default {
},
"Subscription": {
"onEventSubscription": [
- 182,
+ 183,
{
"eventStreamId": [
1,
@@ -14516,16 +14524,16 @@ export default {
}
],
"logicFunctionLogs": [
- 286,
+ 287,
{
"input": [
- 613,
+ 614,
"LogicFunctionLogsInput!"
]
}
],
"onAgentChatEvent": [
- 383,
+ 384,
{
"threadId": [
3,
@@ -14534,23 +14542,23 @@ export default {
}
],
"eventLogsLive": [
- 389,
+ 390,
{
"table": [
- 435,
+ 436,
"EventLogTable!"
],
"fieldFilters": [
- 438,
+ 439,
"[EventLogFieldFilterInput!]"
]
}
],
"exportRecords": [
- 392,
+ 393,
{
"input": [
- 614,
+ 615,
"CreateRecordExportInput!"
]
}
diff --git a/packages/twenty-docs/developers/extend/apps/data/objects.mdx b/packages/twenty-docs/developers/extend/apps/data/objects.mdx
index ef4ed8e831a..06fd087c33e 100644
--- a/packages/twenty-docs/developers/extend/apps/data/objects.mdx
+++ b/packages/twenty-docs/developers/extend/apps/data/objects.mdx
@@ -89,6 +89,7 @@ export default defineObject({
- A parent grants access under its complete policy, the one a query of the parent applies: the reader's permission on the parent object, the row-level restrictions of their role and the parent's own readability. A record never shows through a parent its reader could not query. Subscriptions, webhooks, workflows and logic functions decide what an event of an `INHERITED` record reaches by that same policy.
- The share rows on the record itself grant access exactly as on a `PRIVATE` record. Its creator gets one when the record is created while record sharing is enabled, so whoever created a record keeps seeing it, and a record whose parent fields are all empty is visible to those it was shared with directly.
- An `INHERITED` object that names no usable parent field behaves like a `PRIVATE` one.
+- `sharingReach` sets how far a record of the object can be shared by name: `ObjectSharingReach.WORKSPACE` (the default, a record can be shared with anyone in the workspace, even someone whose role cannot access the object or whose row-level filter hides the record; they get that record only, to view or edit) or `ObjectSharingReach.ROLE_ACCESS` (shares never go beyond role and row-level permissions). Pick `ROLE_ACCESS` for sensitive objects where no access must mean no access. It only applies while record sharing is enabled in the workspace, and only to objects whose records can be shared: `MetadataReadability.OPEN`, `PRIVATE` and `INHERITED` objects that are not system objects. `APPLICATION` and `SYSTEM` objects are never shared.
- `color` sets the accent color of the object in the UI. Omit it and Twenty picks one for the object.
- `imageIdentifierFieldMetadataUniversalIdentifier` names the field whose value is shown as the record avatar. Omit it to let Twenty pick the default.
- `isLabelSyncedWithName`, on an object or on a field, keeps the API name in sync with the label when the label is edited in Settings. It defaults to `false`, so a renamed label leaves the name untouched.
diff --git a/packages/twenty-front/src/generated-metadata/graphql.ts b/packages/twenty-front/src/generated-metadata/graphql.ts
index d7b1ecbf8c7..6ba35cd451c 100644
--- a/packages/twenty-front/src/generated-metadata/graphql.ts
+++ b/packages/twenty-front/src/generated-metadata/graphql.ts
@@ -4715,6 +4715,7 @@ export type Object = {
readability: MetadataReadability;
readabilityParentFieldUniversalIdentifiers?: Maybe<Array<Scalars['UUID']['output']>>;
searchFieldMetadataList: Array<SearchField>;
+ sharingReach: ObjectSharingReach;
shortcut?: Maybe<Scalars['String']['output']>;
universalIdentifier: Scalars['String']['output'];
updatedAt: Scalars['DateTime']['output'];
@@ -4854,6 +4855,11 @@ export enum ObjectRecordGroupByDateGranularity {
YEAR = 'YEAR'
}
+export enum ObjectSharingReach {
+ ROLE_ACCESS = 'ROLE_ACCESS',
+ WORKSPACE = 'WORKSPACE'
+}
+
/** Onboarding status */
export enum OnboardingStatus {
APPS_INSTALLATION = 'APPS_INSTALLATION',
@@ -6688,6 +6694,7 @@ export type UpdateObjectPayload = {
nameSingular?: InputMaybe<Scalars['String']['input']>;
openRecordIn?: InputMaybe<ObjectOpenRecordIn>;
readability?: InputMaybe<MetadataReadability>;
+ sharingReach?: InputMaybe<ObjectSharingReach>;
shortcut?: InputMaybe<Scalars['String']['input']>;
translations?: InputMaybe<Array<MetadataTranslationOverrideInput>>;
};
diff --git a/packages/twenty-front/src/modules/object-metadata/types/EnrichedObjectMetadataItem.ts b/packages/twenty-front/src/modules/object-metadata/types/EnrichedObjectMetadataItem.ts
index d57030ae475..06cc7ac8b0a 100644
--- a/packages/twenty-front/src/modules/object-metadata/types/EnrichedObjectMetadataItem.ts
+++ b/packages/twenty-front/src/modules/object-metadata/types/EnrichedObjectMetadataItem.ts
@@ -16,6 +16,7 @@ export type EnrichedObjectMetadataItem = Omit<
| 'searchFieldMetadataList'
| 'readability'
| 'readabilityParentFieldUniversalIdentifiers'
+ | 'sharingReach'
// Deprecated GraphQL field kept server-side for one release; no longer queried
| 'isUIReadOnly'
> & {
diff --git a/packages/twenty-sdk/src/cli/utilities/build/common/plugins/__tests__/__snapshots__/stub-twenty-sdk-define.plugin.spec.ts.snap b/packages/twenty-sdk/src/cli/utilities/build/common/plugins/__tests__/__snapshots__/stub-twenty-sdk-define.plugin.spec.ts.snap
index 8009171eadf..e598a4e2ddd 100644
--- a/packages/twenty-sdk/src/cli/utilities/build/common/plugins/__tests__/__snapshots__/stub-twenty-sdk-define.plugin.spec.ts.snap
+++ b/packages/twenty-sdk/src/cli/utilities/build/common/plugins/__tests__/__snapshots__/stub-twenty-sdk-define.plugin.spec.ts.snap
@@ -90,6 +90,7 @@ exports[`stub-twenty-sdk-define plugin > matches the recorded export partition 1
"NumberDataType",
"ObjectOpenRecordIn",
"ObjectRecordGroupByDateGranularity",
+ "ObjectSharingReach",
"OnDeleteAction",
"PageLayoutTabLayoutMode",
"PageLayoutType",
diff --git a/packages/twenty-sdk/src/cli/utilities/pull/write-define-file.ts b/packages/twenty-sdk/src/cli/utilities/pull/write-define-file.ts
index d880f634d42..b45abbab67f 100644
--- a/packages/twenty-sdk/src/cli/utilities/pull/write-define-file.ts
+++ b/packages/twenty-sdk/src/cli/utilities/pull/write-define-file.ts
@@ -11,6 +11,7 @@ import {
NavigationMenuItemType,
NumberDataType,
ObjectOpenRecordIn,
+ ObjectSharingReach,
ObjectRecordGroupByDateGranularity,
PageLayoutTabLayoutMode,
PageLayoutType,
@@ -84,6 +85,11 @@ export const OBJECT_ENUM_BINDINGS: EnumBinding[] = [
symbol: 'ObjectOpenRecordIn',
members: ObjectOpenRecordIn,
},
+ {
+ path: ['sharingReach'],
+ symbol: 'ObjectSharingReach',
+ members: ObjectSharingReach,
+ },
...buildFieldEnumBindings(['fields', '[]']),
];
diff --git a/packages/twenty-sdk/src/sdk/define/index.ts b/packages/twenty-sdk/src/sdk/define/index.ts
index bb4229cb81b..8107e4c079d 100644
--- a/packages/twenty-sdk/src/sdk/define/index.ts
+++ b/packages/twenty-sdk/src/sdk/define/index.ts
@@ -221,6 +221,7 @@ export {
NumberDataType,
ObjectOpenRecordIn,
ObjectRecordGroupByDateGranularity,
+ ObjectSharingReach,
PageLayoutTabLayoutMode,
PageLayoutWidgetVerticalListHeightBehavior,
PageLayoutType,
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-45/2-45-instance-command-fast-1790876699146-add-sharing-reach-to-object-metadata.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-45/2-45-instance-command-fast-1790876699146-add-sharing-reach-to-object-metadata.ts
new file mode 100644
index 00000000000..989d46e198f
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-45/2-45-instance-command-fast-1790876699146-add-sharing-reach-to-object-metadata.ts
@@ -0,0 +1,17 @@
+import { QueryRunner } from 'typeorm';
+
+import { RegisteredInstanceCommand } from 'src/engine/core-modules/upgrade/decorators/registered-instance-command.decorator';
+import { FastInstanceCommand } from 'src/engine/core-modules/upgrade/interfaces/fast-instance-command.interface';
+
+@RegisteredInstanceCommand('2.45.0', 1790876699146)
+export class AddSharingReachToObjectMetadataFastInstanceCommand implements FastInstanceCommand {
+ public async up(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query('CREATE TYPE "core"."objectMetadata_sharingreach_enum" AS ENUM(\'ROLE_ACCESS\', \'WORKSPACE\')');
+ await queryRunner.query('ALTER TABLE "core"."objectMetadata" ADD "sharingReach" "core"."objectMetadata_sharingreach_enum" NOT NULL DEFAULT \'WORKSPACE\'');
+ }
+
+ public async down(queryRunner: QueryRunner): Promise<void> {
+ await queryRunner.query('ALTER TABLE "core"."objectMetadata" DROP COLUMN "sharingReach"');
+ await queryRunner.query('DROP TYPE "core"."objectMetadata_sharingreach_enum"');
+ }
+}
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-45/add-object-metadata-sharing-reach-upgrade-command-name.constant.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-45/add-object-metadata-sharing-reach-upgrade-command-name.constant.ts
new file mode 100644
index 00000000000..ddb0826e7ad
--- /dev/null
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-45/add-object-metadata-sharing-reach-upgrade-command-name.constant.ts
@@ -0,0 +1,2 @@
+export const ADD_OBJECT_METADATA_SHARING_REACH_UPGRADE_COMMAND_NAME =
+ '2.45.0_AddSharingReachToObjectMetadataFastInstanceCommand_1790876699146';
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/2-45/utils/__tests__/build-record-share-none-access-level-option-sync-operations.util.spec.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/2-45/utils/__tests__/build-record-share-none-access-level-option-sync-operations.util.spec.ts
index db5dfd52563..8494408937c 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/2-45/utils/__tests__/build-record-share-none-access-level-option-sync-operations.util.spec.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/2-45/utils/__tests__/build-record-share-none-access-level-option-sync-operations.util.spec.ts
@@ -123,12 +123,14 @@ describe('buildRecordShareNoneAccessLevelOptionSyncOperations', () => {
direction: 'down',
});
+ expect(flatEntityToUpdate).toHaveLength(1);
expect(
getOptions(flatEntityToUpdate[0]).map(({ value }) => value),
).not.toContain(RecordShareAccessLevel.NONE);
expect(flatEntityToUpdate[0].defaultValue).toBe(
RECORD_SHARE_ACCESS_LEVEL_DEFAULT_VALUE,
);
+ expect(flatEntityToUpdate[0].updatedAt).toBe(NOW);
});
it('should do nothing when the record share object is not provisioned', () => {
diff --git a/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts b/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
index ddcd5b52875..b2359d06716 100644
--- a/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
+++ b/packages/twenty-server/src/database/commands/upgrade-version-command/instance-commands.constant.ts
@@ -218,6 +218,7 @@ import { AddValidationRuleTableFastInstanceCommand } from 'src/database/commands
import { ReapplyUsageLimitPeriodReshapeFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-44/2-44-instance-command-fast-1790755883509-reapply-usage-limit-period-reshape';
import { AddChatWidgetTypeFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-44/2-44-instance-command-fast-1790756560653-add-chat-widget-type';
import { DropLegacyCampaignSendingCoreTablesFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-45/2-45-instance-command-fast-1790842027068-drop-legacy-campaign-sending-core-tables';
+import { AddSharingReachToObjectMetadataFastInstanceCommand } from 'src/database/commands/upgrade-version-command/2-45/2-45-instance-command-fast-1790876699146-add-sharing-reach-to-object-metadata';
export const INSTANCE_COMMANDS = [
AddViewFieldGroupIdIndexOnViewFieldFastInstanceCommand,
@@ -438,4 +439,5 @@ export const INSTANCE_COMMANDS = [
AddChatWidgetTypeFastInstanceCommand,
DropLegacyCampaignSendingCoreTablesFastInstanceCommand,
AddApplicationWorkflowSideEffectsFastInstanceCommand,
+ AddSharingReachToObjectMetadataFastInstanceCommand,
];
diff --git a/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/__mocks__/mockPersonObjectMetadata.ts b/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/__mocks__/mockPersonObjectMetadata.ts
index b70e7a959f0..a3f0ef19bd7 100644
--- a/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/__mocks__/mockPersonObjectMetadata.ts
+++ b/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/__mocks__/mockPersonObjectMetadata.ts
@@ -3,6 +3,7 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
} from 'twenty-shared/types';
import { type WorkspaceEntityDuplicateCriteria } from 'src/engine/api/graphql/workspace-query-builder/types/workspace-entity-duplicate-criteria.type';
@@ -177,6 +178,7 @@ export const mockPersonFlatObjectMetadata = (
writability: MetadataWritability.OPEN,
readability: MetadataReadability.OPEN,
readabilityParentFieldUniversalIdentifiers: null,
+ sharingReach: ObjectSharingReach.WORKSPACE,
openRecordIn: ObjectOpenRecordIn.USER_CHOICE,
applicationUniversalIdentifier: 'test-application-id',
fieldUniversalIdentifiers: mockFieldMetadatas.map(
diff --git a/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/graphql-query-filter/graphql-query-filter-field.parser.ts b/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/graphql-query-filter/graphql-query-filter-field.parser.ts
index 818cc0dd0fa..2f7e9d4a261 100644
--- a/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/graphql-query-filter/graphql-query-filter-field.parser.ts
+++ b/packages/twenty-server/src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/graphql-query-filter/graphql-query-filter-field.parser.ts
@@ -10,6 +10,7 @@ import {
GraphqlQueryRunnerExceptionCode,
} from 'src/engine/api/graphql/graphql-query-runner/errors/graphql-query-runner.exception';
import { addRelationJoinAliasToQueryBuilder } from 'src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/utils/add-relation-join-alias.util';
+import { isRecordGrantBeyondRoleAllowed } from 'src/engine/core-modules/record-share/utils/is-record-grant-beyond-role-allowed.util';
import { assertFieldIsReadableOrThrow } from 'src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/utils/assert-field-is-readable-or-throw.util';
import { resolveFilterKeyFieldMetadata } from 'src/engine/api/graphql/graphql-query-runner/graphql-query-parsers/utils/resolve-filter-key-field-metadata.util';
import { assertArrayOperatorValueIsNonEmptyArray } from 'src/engine/api/graphql/graphql-query-runner/utils/assert-array-operator-value-is-non-empty-array.util';
@@ -84,7 +85,19 @@ export class GraphqlQueryFilterFieldParser {
const objectPermissions =
outerQueryBuilder.objectRecordsPermissions[this.flatObjectMetadata.id];
- if (objectPermissions?.canReadObjectRecords === false) {
+ // Filtering the queried object itself stays possible on records shared by
+ // name, while a filter through a relation still needs the object readable
+ if (
+ objectPermissions?.canReadObjectRecords === false &&
+ !(
+ this.depth === 0 &&
+ isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: this.flatObjectMetadata,
+ operationType: 'select',
+ isRecordSharingEnabled: outerQueryBuilder.isRecordSharingEnabled,
+ })
+ )
+ ) {
throw new PermissionsException(
PermissionsExceptionMessage.PERMISSION_DENIED,
PermissionsExceptionCode.PERMISSION_DENIED,
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-object-metadata-to-object-manifest.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-object-metadata-to-object-manifest.util.spec.ts
index b70b116acce..9f35a96998d 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-object-metadata-to-object-manifest.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-flat-object-metadata-to-object-manifest.util.spec.ts
@@ -3,6 +3,7 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
} from 'twenty-shared/types';
import { fromFlatObjectMetadataToObjectManifest } from 'src/engine/core-modules/application/application-manifest/converters/from-flat-object-metadata-to-object-manifest.util';
@@ -33,6 +34,7 @@ const OBJECT_MANIFEST: Required<ObjectManifest> = {
writability: MetadataWritability.APPLICATION,
readability: MetadataReadability.INHERITED,
readabilityParentFieldUniversalIdentifiers: [PARENT_FIELD_UID],
+ sharingReach: ObjectSharingReach.WORKSPACE,
openRecordIn: ObjectOpenRecordIn.RECORD_PAGE,
labelIdentifierFieldMetadataUniversalIdentifier: LABEL_FIELD_UID,
imageIdentifierFieldMetadataUniversalIdentifier: IMAGE_FIELD_UID,
@@ -69,6 +71,7 @@ describe('fromFlatObjectMetadataToObjectManifest', () => {
writability: MetadataWritability.APPLICATION,
readability: MetadataReadability.INHERITED,
readabilityParentFieldUniversalIdentifiers: [PARENT_FIELD_UID],
+ sharingReach: ObjectSharingReach.WORKSPACE,
openRecordIn: ObjectOpenRecordIn.SIDE_PANEL,
labelIdentifierFieldMetadataUniversalIdentifier: LABEL_FIELD_UID,
imageIdentifierFieldMetadataUniversalIdentifier: null,
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-object-manifest-to-universal-flat-object-metadata.util.spec.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-object-manifest-to-universal-flat-object-metadata.util.spec.ts
index fc93e417d8b..2c41719b2f3 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-object-manifest-to-universal-flat-object-metadata.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/__tests__/from-object-manifest-to-universal-flat-object-metadata.util.spec.ts
@@ -1,5 +1,9 @@
import { type ObjectManifest } from 'twenty-shared/application';
-import { MetadataReadability, MetadataWritability } from 'twenty-shared/types';
+import {
+ MetadataReadability,
+ MetadataWritability,
+ ObjectSharingReach,
+} from 'twenty-shared/types';
import { fromObjectManifestToUniversalFlatObjectMetadata } from 'src/engine/core-modules/application/application-manifest/converters/from-object-manifest-to-universal-flat-object-metadata.util';
@@ -135,6 +139,30 @@ describe('fromObjectManifestToUniversalFlatObjectMetadata', () => {
});
});
+ describe('sharingReach', () => {
+ it('defaults to WORKSPACE when omitted from the manifest', () => {
+ const result = fromObjectManifestToUniversalFlatObjectMetadata({
+ objectManifest: buildObjectManifest({}),
+ applicationUniversalIdentifier: APP_UID,
+ now: NOW,
+ });
+
+ expect(result.sharingReach).toBe(ObjectSharingReach.WORKSPACE);
+ });
+
+ it('carries the manifest value through', () => {
+ const result = fromObjectManifestToUniversalFlatObjectMetadata({
+ objectManifest: buildObjectManifest({
+ sharingReach: ObjectSharingReach.ROLE_ACCESS,
+ }),
+ applicationUniversalIdentifier: APP_UID,
+ now: NOW,
+ });
+
+ expect(result.sharingReach).toBe(ObjectSharingReach.ROLE_ACCESS);
+ });
+ });
+
describe('fidelity properties', () => {
it('should default color, label sync and image identifier', () => {
const result = fromObjectManifestToUniversalFlatObjectMetadata({
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-flat-object-metadata-to-object-manifest.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-flat-object-metadata-to-object-manifest.util.ts
index 2540bd445a1..eefa7514b20 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-flat-object-metadata-to-object-manifest.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-flat-object-metadata-to-object-manifest.util.ts
@@ -35,6 +35,7 @@ export const fromFlatObjectMetadataToObjectManifest = ({
readability: flatObjectMetadata.readability,
readabilityParentFieldUniversalIdentifiers:
flatObjectMetadata.readabilityParentFieldUniversalIdentifiers,
+ sharingReach: flatObjectMetadata.sharingReach,
openRecordIn: flatObjectMetadata.openRecordIn,
labelIdentifierFieldMetadataUniversalIdentifier,
imageIdentifierFieldMetadataUniversalIdentifier:
diff --git a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-object-manifest-to-universal-flat-object-metadata.util.ts b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-object-manifest-to-universal-flat-object-metadata.util.ts
index 0e5b5f33dd4..e1289c999f7 100644
--- a/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-object-manifest-to-universal-flat-object-metadata.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/application/application-manifest/converters/from-object-manifest-to-universal-flat-object-metadata.util.ts
@@ -3,6 +3,7 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
} from 'twenty-shared/types';
import { type UniversalFlatObjectMetadata } from 'src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/universal-flat-object-metadata.type';
@@ -38,6 +39,7 @@ export const fromObjectManifestToUniversalFlatObjectMetadata = ({
readability: objectManifest.readability ?? MetadataReadability.OPEN,
readabilityParentFieldUniversalIdentifiers:
objectManifest.readabilityParentFieldUniversalIdentifiers ?? null,
+ sharingReach: objectManifest.sharingReach ?? ObjectSharingReach.WORKSPACE,
isAuditLogged: true,
isSearchable: objectManifest.isSearchable ?? true,
duplicateCriteria: null,
diff --git a/packages/twenty-server/src/engine/core-modules/event-emitter/utils/__tests__/object-record-changed-values.spec.ts b/packages/twenty-server/src/engine/core-modules/event-emitter/utils/__tests__/object-record-changed-values.spec.ts
index 380f7f99f2d..e2c1863c3e1 100644
--- a/packages/twenty-server/src/engine/core-modules/event-emitter/utils/__tests__/object-record-changed-values.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/event-emitter/utils/__tests__/object-record-changed-values.spec.ts
@@ -3,6 +3,7 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
RelationType,
} from 'twenty-shared/types';
@@ -51,6 +52,7 @@ const mockObjectMetadata: FlatObjectMetadata = {
writability: MetadataWritability.OPEN,
readability: MetadataReadability.OPEN,
readabilityParentFieldUniversalIdentifiers: null,
+ sharingReach: ObjectSharingReach.WORKSPACE,
openRecordIn: ObjectOpenRecordIn.USER_CHOICE,
labelIdentifierFieldMetadataId: null,
imageIdentifierFieldMetadataId: null,
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/services/record-access-policy.service.ts b/packages/twenty-server/src/engine/core-modules/record-share/services/record-access-policy.service.ts
index ff130a66434..d56740a51e6 100644
--- a/packages/twenty-server/src/engine/core-modules/record-share/services/record-access-policy.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/record-share/services/record-access-policy.service.ts
@@ -18,8 +18,10 @@ import {
type EventRecordSnapshot,
resolveEventRecordSnapshots,
} from 'src/engine/core-modules/record-share/utils/resolve-event-record-snapshots.util';
+import { resolveNamedPrincipalIds } from 'src/engine/core-modules/record-share/utils/resolve-named-principal-ids.util';
import { resolveRecordIdsRestrictedForPrincipals } from 'src/engine/core-modules/record-share/utils/resolve-record-ids-restricted-for-principals.util';
import { resolveRecordIdsSharedWithPrincipals } from 'src/engine/core-modules/record-share/utils/resolve-record-ids-shared-with-principals.util';
+import { isRecordGrantBeyondRoleAllowed } from 'src/engine/core-modules/record-share/utils/is-record-grant-beyond-role-allowed.util';
import { isRecordShareExceptionObject } from 'src/engine/core-modules/record-share/utils/is-record-share-exception-object.util';
import { resolveRecordShareGateKind } from 'src/engine/core-modules/record-share/utils/resolve-record-share-gate-kind.util';
import { MAX_INHERITED_READABILITY_DEPTH } from 'src/engine/core-modules/record-share/constants/max-inherited-readability-depth.constant';
@@ -86,28 +88,36 @@ export class RecordAccessPolicyService {
return {
resolveAdmittedRecordIds: async (subject) => {
+ const eventSnapshots = resolveEventRecordSnapshots(events);
const snapshots = await this.resolveSnapshotsReadableByRole({
workspaceId,
objectMetadata,
- snapshots: resolveEventRecordSnapshots(events),
+ snapshots: eventSnapshots,
subject,
depth: 0,
});
- if (snapshots.length === 0) {
- return new Set();
- }
+ const admittedSnapshotIds =
+ snapshots.length === 0
+ ? new Set<string>()
+ : await this.resolveSnapshotIdsAdmittedByRecordShareGate(
+ {
+ workspaceId,
+ objectMetadata,
+ snapshots,
+ subject,
+ depth: 0,
+ },
+ fetchRecordShares,
+ );
- return this.resolveSnapshotIdsAdmittedByRecordShareGate(
- {
- workspaceId,
- objectMetadata,
- snapshots,
- subject,
- depth: 0,
- },
- fetchRecordShares,
- );
+ return new Set([
+ ...admittedSnapshotIds,
+ ...(await this.resolveSnapshotIdsGrantedBeyondRole(
+ { workspaceId, objectMetadata, snapshots: eventSnapshots, subject },
+ fetchRecordShares,
+ )),
+ ]);
},
};
}
@@ -203,14 +213,45 @@ export class RecordAccessPolicyService {
}
}
- private async areRecordShareExceptionsEnforced({
- workspaceId,
- objectMetadata,
- }: SnapshotEvaluation): Promise<boolean> {
- if (!isRecordShareExceptionObject(objectMetadata)) {
- return false;
+ // A record shared by name reaches its recipients whatever their role or row
+ // filter says about the object, as the row access policy does
+ private async resolveSnapshotIdsGrantedBeyondRole(
+ {
+ workspaceId,
+ objectMetadata,
+ snapshots,
+ subject,
+ }: Omit<SnapshotEvaluation, 'depth'>,
+ fetchRecordShares: FetchRecordShares,
+ ): Promise<Set<string>> {
+ const namedPrincipalIds = resolveNamedPrincipalIds(subject);
+
+ if (
+ snapshots.length === 0 ||
+ namedPrincipalIds.length === 0 ||
+ !isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: objectMetadata,
+ operationType: 'select',
+ isRecordSharingEnabled: await this.isRecordSharingEnabled(workspaceId),
+ })
+ ) {
+ return new Set();
}
+ const grantedRecordIds = resolveRecordIdsSharedWithPrincipals({
+ recordShares: await fetchRecordShares(),
+ principalIds: namedPrincipalIds,
+ accessLevels: resolveRequiredRecordShareAccessLevels('select'),
+ });
+
+ return new Set(
+ snapshots
+ .map((snapshot) => snapshot.id)
+ .filter((snapshotId) => grantedRecordIds.has(snapshotId)),
+ );
+ }
+
+ private async isRecordSharingEnabled(workspaceId: string): Promise<boolean> {
const { featureFlagsMap } = await this.workspaceCacheService.getOrRecompute(
workspaceId,
['featureFlagsMap'],
@@ -221,6 +262,16 @@ export class RecordAccessPolicyService {
);
}
+ private async areRecordShareExceptionsEnforced({
+ workspaceId,
+ objectMetadata,
+ }: SnapshotEvaluation): Promise<boolean> {
+ return (
+ isRecordShareExceptionObject(objectMetadata) &&
+ (await this.isRecordSharingEnabled(workspaceId))
+ );
+ }
+
private async resolveSnapshotIdsNotRestrictedForSubject(
{ snapshots, subject }: SnapshotEvaluation,
fetchRecordShares: FetchRecordShares,
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/services/record-sharing.service.ts b/packages/twenty-server/src/engine/core-modules/record-share/services/record-sharing.service.ts
index b289cbdd978..1e15e5f8588 100644
--- a/packages/twenty-server/src/engine/core-modules/record-share/services/record-sharing.service.ts
+++ b/packages/twenty-server/src/engine/core-modules/record-share/services/record-sharing.service.ts
@@ -23,6 +23,7 @@ import {
import { RecordShareStorageService } from 'src/engine/core-modules/record-share/services/record-share-storage.service';
import { type RecordShareInput } from 'src/engine/core-modules/record-share/types/record-share-input.type';
import { isRecordShareExceptionObject } from 'src/engine/core-modules/record-share/utils/is-record-share-exception-object.util';
+import { isRecordShareableObject } from 'src/engine/core-modules/record-share/utils/is-record-shareable-object.util';
import { resolveRecordGeneralAccess } from 'src/engine/core-modules/record-share/utils/resolve-record-general-access.util';
import { resolveShareWithPrincipalOrThrow } from 'src/engine/core-modules/record-share/utils/resolve-share-with-principal-or-throw.util';
import { resolveViewerRecordShareAccessLevel } from 'src/engine/core-modules/record-share/utils/resolve-viewer-record-share-access-level.util';
@@ -49,6 +50,7 @@ const CREATED_BY_WORKSPACE_MEMBER_ID_COLUMN_NAME = 'createdByWorkspaceMemberId';
type RecordSharingObject = {
objectMetadata: FlatObjectMetadata;
+ isRecordSharingEnabled: boolean;
isRecordShareExceptionObject: boolean;
};
@@ -133,7 +135,11 @@ export class RecordSharingService {
await this.getRecordShares({ ...args, sharingObject });
const canChangeSharing =
permissions.canUpdate &&
- viewerAccessLevel === RecordShareAccessLevel.FULL;
+ viewerAccessLevel === RecordShareAccessLevel.FULL &&
+ (await this.isUpdatePermittedByRole({
+ authContext: args.authContext,
+ objectMetadata,
+ }));
const { flatRoleMaps } = canChangeSharing
? await this.workspaceCacheService.getOrRecompute(
args.authContext.workspace.id,
@@ -221,7 +227,12 @@ export class RecordSharingService {
operationType: 'update',
withDeleted: args.withDeleted ?? true,
});
- if (writableIds.length !== 1) {
+ // A grant may let someone edit a record beyond their role, never
+ // decide who else gets it
+ if (
+ writableIds.length !== 1 ||
+ !repository.isObjectOperationPermittedByRole('update')
+ ) {
throw new NotFoundError('Record not found');
}
const { viewerAccessLevel, creatorWorkspaceMemberId } =
@@ -470,12 +481,26 @@ export class RecordSharingService {
private isShareable({
objectMetadata,
- isRecordShareExceptionObject,
+ isRecordSharingEnabled,
}: RecordSharingObject): boolean {
- return (
- isRecordShareExceptionObject ||
- objectMetadata.readability === MetadataReadability.PRIVATE ||
- objectMetadata.readability === MetadataReadability.INHERITED
+ return isRecordShareableObject({
+ flatObjectMetadata: objectMetadata,
+ isRecordSharingEnabled,
+ });
+ }
+
+ private isUpdatePermittedByRole({
+ authContext,
+ objectMetadata,
+ }: Pick<RecordSharingArgs, 'authContext'> & {
+ objectMetadata: Pick<FlatObjectMetadata, 'nameSingular'>;
+ }): Promise<boolean> {
+ return this.workspaceOrmManager.executeInWorkspaceContext(
+ () =>
+ this.workspaceOrmManager
+ .getRepositoryWithContextPermissions(objectMetadata.nameSingular)
+ .isObjectOperationPermittedByRole('update'),
+ authContext,
);
}
@@ -494,12 +519,13 @@ export class RecordSharingService {
if (!isDefined(objectMetadata)) {
throw new NotFoundError('Record not found');
}
+ const isRecordSharingEnabled =
+ featureFlagsMap[FeatureFlagKey.IS_RECORD_LEVEL_SHARING_ENABLED] ?? false;
return {
objectMetadata,
+ isRecordSharingEnabled,
isRecordShareExceptionObject:
- (featureFlagsMap[FeatureFlagKey.IS_RECORD_LEVEL_SHARING_ENABLED] ??
- false) &&
- isRecordShareExceptionObject(objectMetadata),
+ isRecordSharingEnabled && isRecordShareExceptionObject(objectMetadata),
};
}
}
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/build-record-share-condition.util.spec.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/build-record-share-condition.util.spec.ts
index f343cdb2ef7..6e86ef59d70 100644
--- a/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/build-record-share-condition.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/build-record-share-condition.util.spec.ts
@@ -2,8 +2,8 @@
import { RecordShareAccessLevel } from 'twenty-shared/types';
-import { compileNamedParameters } from 'src/engine/twenty-orm/sql/utils/compile-named-parameters.util';
import { buildRecordShareCondition } from 'src/engine/core-modules/record-share/utils/build-record-share-condition.util';
+import { compileNamedParameters } from 'src/engine/twenty-orm/sql/utils/compile-named-parameters.util';
const OBJECT_METADATA_ID = 'object-metadata-1';
const PRINCIPAL_IDS = ['principal-1', 'principal-2'];
@@ -83,4 +83,25 @@ describe('buildRecordShareCondition', () => {
expect(sql).toContain('AS "per""son_recordShare"');
expect(sql).toContain('= "per""son"."id"');
});
+
+ it('should match the record id against the grants read once when uncorrelated', () => {
+ const { sql, parameters } = buildRecordShareCondition({
+ tableAlias: 'company',
+ recordShareTableExpression: '"workspace_abc"."recordShare"',
+ objectMetadataId: OBJECT_METADATA_ID,
+ principalIds: ['principal-1'],
+ accessLevels: [RecordShareAccessLevel.READ, RecordShareAccessLevel.FULL],
+ isUncorrelated: true,
+ });
+
+ expect(compileNamedParameters(sql, parameters)).toEqual({
+ text: '"company"."id" = ANY(ARRAY(SELECT "company_recordShare"."recordId" FROM "workspace_abc"."recordShare" AS "company_recordShare" WHERE "company_recordShare"."objectMetadataId" = $1 AND "company_recordShare"."principalId" = ANY($2) AND "company_recordShare"."accessLevel" IN ($3, $4) AND "company_recordShare"."deletedAt" IS NULL))',
+ values: [
+ OBJECT_METADATA_ID,
+ ['principal-1'],
+ RecordShareAccessLevel.READ,
+ RecordShareAccessLevel.FULL,
+ ],
+ });
+ });
});
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/build-record-share-exception-condition.util.spec.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/build-record-share-exception-condition.util.spec.ts
index 5abc8f7dbfd..beec84f297e 100644
--- a/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/build-record-share-exception-condition.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/build-record-share-exception-condition.util.spec.ts
@@ -40,7 +40,7 @@ describe('buildRecordShareExceptionCondition', () => {
EVERYONE_PRINCIPAL_ID,
RecordShareAccessLevel.NONE,
RecordShareAccessLevel.READ,
- PRINCIPAL_IDS,
+ ['principal-1'],
RecordShareAccessLevel.READ_WRITE,
RecordShareAccessLevel.FULL,
],
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/is-record-grant-beyond-role-allowed.util.spec.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/is-record-grant-beyond-role-allowed.util.spec.ts
new file mode 100644
index 00000000000..783891b49ce
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/is-record-grant-beyond-role-allowed.util.spec.ts
@@ -0,0 +1,94 @@
+/* @license Enterprise */
+
+import { MetadataReadability, ObjectSharingReach } from 'twenty-shared/types';
+
+import { isRecordGrantBeyondRoleAllowed } from 'src/engine/core-modules/record-share/utils/is-record-grant-beyond-role-allowed.util';
+
+const OPEN_OBJECT = {
+ readability: MetadataReadability.OPEN,
+ isSystem: false,
+ sharingReach: ObjectSharingReach.WORKSPACE,
+};
+
+describe('isRecordGrantBeyondRoleAllowed', () => {
+ it.each(['select', 'update'] as const)(
+ 'should let a grant reach beyond the role to %s',
+ (operationType) => {
+ expect(
+ isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: OPEN_OBJECT,
+ operationType,
+ isRecordSharingEnabled: true,
+ }),
+ ).toBe(true);
+ },
+ );
+
+ it.each(['insert', 'delete', 'soft-delete', 'restore'] as const)(
+ 'should keep %s with the role',
+ (operationType) => {
+ expect(
+ isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: OPEN_OBJECT,
+ operationType,
+ isRecordSharingEnabled: true,
+ }),
+ ).toBe(false);
+ },
+ );
+
+ it('should stay within the role when the object limits sharing to it', () => {
+ expect(
+ isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: {
+ ...OPEN_OBJECT,
+ sharingReach: ObjectSharingReach.ROLE_ACCESS,
+ },
+ operationType: 'select',
+ isRecordSharingEnabled: true,
+ }),
+ ).toBe(false);
+ });
+
+ it('should stay within the role while record sharing is disabled', () => {
+ expect(
+ isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: OPEN_OBJECT,
+ operationType: 'select',
+ isRecordSharingEnabled: false,
+ }),
+ ).toBe(false);
+ });
+
+ it.each([
+ { readability: MetadataReadability.SYSTEM, isSystem: false },
+ { readability: MetadataReadability.APPLICATION, isSystem: false },
+ { readability: MetadataReadability.OPEN, isSystem: true },
+ { readability: MetadataReadability.PRIVATE, isSystem: true },
+ { readability: MetadataReadability.INHERITED, isSystem: true },
+ ])(
+ 'should never reach an object whose records cannot be shared (%o)',
+ (object) => {
+ expect(
+ isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: { ...OPEN_OBJECT, ...object },
+ operationType: 'select',
+ isRecordSharingEnabled: true,
+ }),
+ ).toBe(false);
+ },
+ );
+
+ it.each([MetadataReadability.PRIVATE, MetadataReadability.INHERITED])(
+ 'should reach a %s object',
+ (readability) => {
+ expect(
+ isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: { ...OPEN_OBJECT, readability },
+ operationType: 'update',
+ isRecordSharingEnabled: true,
+ }),
+ ).toBe(true);
+ },
+ );
+});
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/resolve-record-ids-restricted-for-principals.util.spec.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/resolve-record-ids-restricted-for-principals.util.spec.ts
index 0986cd1715f..91830476c69 100644
--- a/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/resolve-record-ids-restricted-for-principals.util.spec.ts
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/__tests__/resolve-record-ids-restricted-for-principals.util.spec.ts
@@ -111,6 +111,31 @@ describe('resolveRecordIdsRestrictedForPrincipals', () => {
).toEqual(new Set(['restricted']));
});
+ it('should not let another everyone row lift a restriction', () => {
+ expect(
+ resolveRecordIdsRestrictedForPrincipals({
+ recordShares: [
+ buildShare(
+ 'restricted',
+ EVERYONE_PRINCIPAL_ID,
+ RecordShareAccessLevel.NONE,
+ ),
+ {
+ ...buildShare(
+ 'restricted',
+ EVERYONE_PRINCIPAL_ID,
+ RecordShareAccessLevel.FULL,
+ ),
+ rowCause: RecordShareRowCause.APPLICATION,
+ sourceId: 'application-1',
+ },
+ ],
+ principalIds: [EVERYONE_PRINCIPAL_ID, MEMBER_ID],
+ accessLevels: SELECT_ACCESS_LEVELS,
+ }),
+ ).toEqual(new Set(['restricted']));
+ });
+
it('should ignore grants to other principals', () => {
expect(
resolveRecordIdsRestrictedForPrincipals({
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/build-named-record-grant-condition.util.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/build-named-record-grant-condition.util.ts
new file mode 100644
index 00000000000..1b6ff733858
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/build-named-record-grant-condition.util.ts
@@ -0,0 +1,33 @@
+/* @license Enterprise */
+
+import { isNonEmptyArray } from 'twenty-shared/utils';
+
+import { buildRecordShareCondition } from 'src/engine/core-modules/record-share/utils/build-record-share-condition.util';
+import { resolveNamedPrincipalIds } from 'src/engine/core-modules/record-share/utils/resolve-named-principal-ids.util';
+import { resolveRequiredRecordShareAccessLevels } from 'src/engine/core-modules/record-share/utils/resolve-required-record-share-access-levels.util';
+import {
+ type RowAccessPolicyContext,
+ type RowAccessPolicyTarget,
+ type SqlCondition,
+} from 'src/engine/twenty-orm/types/row-access-policy.type';
+
+export const buildNamedRecordGrantCondition = (
+ { subject, environment }: RowAccessPolicyContext,
+ { tableAlias, flatObjectMetadata, operationType }: RowAccessPolicyTarget,
+): SqlCondition | undefined => {
+ const principalIds = resolveNamedPrincipalIds(subject);
+ const accessLevels = resolveRequiredRecordShareAccessLevels(operationType);
+
+ if (!isNonEmptyArray(principalIds) || !isNonEmptyArray(accessLevels)) {
+ return undefined;
+ }
+
+ return buildRecordShareCondition({
+ tableAlias,
+ recordShareTableExpression: environment.recordShareTableExpression,
+ objectMetadataId: flatObjectMetadata.id,
+ principalIds,
+ accessLevels,
+ isUncorrelated: true,
+ });
+};
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/build-record-share-condition.util.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/build-record-share-condition.util.ts
index 485428bf91d..013bdcc66b4 100644
--- a/packages/twenty-server/src/engine/core-modules/record-share/utils/build-record-share-condition.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/build-record-share-condition.util.ts
@@ -13,12 +13,14 @@ export const buildRecordShareCondition = ({
objectMetadataId,
principalIds,
accessLevels,
+ isUncorrelated = false,
}: {
tableAlias: string;
recordShareTableExpression: string;
objectMetadataId: string;
principalIds: string[];
accessLevels: RecordShareAccessLevel[];
+ isUncorrelated?: boolean;
}): { sql: string; parameters: ObjectLiteral } => {
const parameterSuffix = randomBytes(5).toString('hex');
const objectMetadataIdParameterName = `recordShareObjectMetadataId_${parameterSuffix}`;
@@ -27,16 +29,21 @@ export const buildRecordShareCondition = ({
const recordShareAlias = escapeIdentifier(`${tableAlias}_recordShare`);
- const conditions = [
- `${recordShareAlias}."recordId" = ${escapeIdentifier(tableAlias)}."id"`,
+ const recordId = `${escapeIdentifier(tableAlias)}."id"`;
+ const grantConditions = [
`${recordShareAlias}."objectMetadataId" = :${objectMetadataIdParameterName}`,
`${recordShareAlias}."principalId" = ANY(:${principalIdsParameterName})`,
`${recordShareAlias}."accessLevel" IN (:...${accessLevelsParameterName})`,
`${recordShareAlias}."deletedAt" IS NULL`,
];
+ const fromRecordShares = `FROM ${recordShareTableExpression} AS ${recordShareAlias}`;
return {
- sql: `EXISTS (SELECT 1 FROM ${recordShareTableExpression} AS ${recordShareAlias} WHERE ${conditions.join(' AND ')})`,
+ // Uncorrelated, Postgres reads the grants once and can OR them with an
+ // indexed row filter instead of probing the share table for every row
+ sql: isUncorrelated
+ ? `${recordId} = ANY(ARRAY(SELECT ${recordShareAlias}."recordId" ${fromRecordShares} WHERE ${grantConditions.join(' AND ')}))`
+ : `EXISTS (SELECT 1 ${fromRecordShares} WHERE ${[`${recordShareAlias}."recordId" = ${recordId}`, ...grantConditions].join(' AND ')})`,
parameters: {
[objectMetadataIdParameterName]: objectMetadataId,
[principalIdsParameterName]: principalIds,
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/build-record-share-exception-condition.util.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/build-record-share-exception-condition.util.ts
index 861b5d330fd..9d32867c555 100644
--- a/packages/twenty-server/src/engine/core-modules/record-share/utils/build-record-share-exception-condition.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/build-record-share-exception-condition.util.ts
@@ -10,7 +10,8 @@ import { escapeIdentifier } from 'src/engine/workspace-manager/workspace-migrati
// A record of an object open by default carries share rows only when it
// departs from that default: an everyone row below the required level
-// restricts it, and a grant to one of the principals lifts the restriction.
+// restricts it, and a grant naming one of the principals lifts the
+// restriction: another everyone row, such as one an application wrote, does not.
// Kept as a single NOT EXISTS so the planner can use an anti-join instead of
// a per-row subplan, which an OR with the grant check would force.
export const buildRecordShareExceptionCondition = ({
@@ -66,7 +67,9 @@ export const buildRecordShareExceptionCondition = ({
[restrictedAccessLevelsParameterName]: Object.values(
RecordShareAccessLevel,
).filter((accessLevel) => !accessLevels.includes(accessLevel)),
- [principalIdsParameterName]: principalIds,
+ [principalIdsParameterName]: principalIds.filter(
+ (principalId) => principalId !== EVERYONE_PRINCIPAL_ID,
+ ),
[accessLevelsParameterName]: accessLevels,
},
};
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/is-record-grant-beyond-role-allowed.util.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/is-record-grant-beyond-role-allowed.util.ts
new file mode 100644
index 00000000000..e9a8e625d40
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/is-record-grant-beyond-role-allowed.util.ts
@@ -0,0 +1,33 @@
+/* @license Enterprise */
+
+import { ObjectSharingReach } from 'twenty-shared/types';
+
+import { isRecordShareableObject } from 'src/engine/core-modules/record-share/utils/is-record-shareable-object.util';
+import { type FlatObjectMetadata } from 'src/engine/metadata-modules/flat-object-metadata/types/flat-object-metadata.type';
+import { type OperationType } from 'src/engine/twenty-orm/repository/permissions.utils';
+
+// A record shared by name reaches people whose role cannot otherwise access
+// its object, but only to view or edit it: deleting it, creating siblings or
+// managing its access stay with the roles that can access the object
+const OPERATION_TYPES_GRANTABLE_BEYOND_ROLE: OperationType[] = [
+ 'select',
+ 'update',
+];
+
+export const isRecordGrantBeyondRoleAllowed = ({
+ flatObjectMetadata,
+ operationType,
+ isRecordSharingEnabled,
+}: {
+ flatObjectMetadata: Pick<
+ FlatObjectMetadata,
+ 'readability' | 'isSystem' | 'sharingReach'
+ >;
+ operationType: OperationType;
+ isRecordSharingEnabled: boolean;
+}): boolean =>
+ isRecordSharingEnabled &&
+ !flatObjectMetadata.isSystem &&
+ flatObjectMetadata.sharingReach === ObjectSharingReach.WORKSPACE &&
+ OPERATION_TYPES_GRANTABLE_BEYOND_ROLE.includes(operationType) &&
+ isRecordShareableObject({ flatObjectMetadata, isRecordSharingEnabled });
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/is-record-shareable-object.util.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/is-record-shareable-object.util.ts
new file mode 100644
index 00000000000..36390eb6355
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/is-record-shareable-object.util.ts
@@ -0,0 +1,17 @@
+/* @license Enterprise */
+
+import { MetadataReadability } from 'twenty-shared/types';
+
+import { isRecordShareExceptionObject } from 'src/engine/core-modules/record-share/utils/is-record-share-exception-object.util';
+import { type FlatObjectMetadata } from 'src/engine/metadata-modules/flat-object-metadata/types/flat-object-metadata.type';
+
+export const isRecordShareableObject = ({
+ flatObjectMetadata,
+ isRecordSharingEnabled,
+}: {
+ flatObjectMetadata: Pick<FlatObjectMetadata, 'readability' | 'isSystem'>;
+ isRecordSharingEnabled: boolean;
+}): boolean =>
+ flatObjectMetadata.readability === MetadataReadability.PRIVATE ||
+ flatObjectMetadata.readability === MetadataReadability.INHERITED ||
+ (isRecordSharingEnabled && isRecordShareExceptionObject(flatObjectMetadata));
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/resolve-named-principal-ids.util.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/resolve-named-principal-ids.util.ts
new file mode 100644
index 00000000000..45991490843
--- /dev/null
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/resolve-named-principal-ids.util.ts
@@ -0,0 +1,14 @@
+/* @license Enterprise */
+
+import { EVERYONE_PRINCIPAL_ID } from 'twenty-shared/constants';
+
+import { type RowAccessPolicySubject } from 'src/engine/twenty-orm/types/row-access-policy.type';
+
+// Only a grant naming the member or one of their roles reaches beyond the
+// role: general access goes as far as the people who can access the object
+export const resolveNamedPrincipalIds = (
+ subject: Pick<RowAccessPolicySubject, 'principalIds'>,
+): string[] =>
+ (subject.principalIds ?? []).filter(
+ (principalId) => principalId !== EVERYONE_PRINCIPAL_ID,
+ );
diff --git a/packages/twenty-server/src/engine/core-modules/record-share/utils/resolve-record-ids-restricted-for-principals.util.ts b/packages/twenty-server/src/engine/core-modules/record-share/utils/resolve-record-ids-restricted-for-principals.util.ts
index 15642eeeacc..9f05ec547de 100644
--- a/packages/twenty-server/src/engine/core-modules/record-share/utils/resolve-record-ids-restricted-for-principals.util.ts
+++ b/packages/twenty-server/src/engine/core-modules/record-share/utils/resolve-record-ids-restricted-for-principals.util.ts
@@ -18,7 +18,9 @@ export const resolveRecordIdsRestrictedForPrincipals = ({
}): Set<string> => {
const liftedRecordIds = resolveRecordIdsSharedWithPrincipals({
recordShares,
- principalIds,
+ principalIds: principalIds.filter(
+ (principalId) => principalId !== EVERYONE_PRINCIPAL_ID,
+ ),
accessLevels,
});
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap
index 84ab9d50f0f..23fa4cbea1a 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/__tests__/__snapshots__/all-universal-flat-entity-properties-to-compare-and-stringify.constant.spec.ts.snap
@@ -192,6 +192,7 @@ exports[`ALL_UNIVERSAL_FLAT_ENTITY_PROPERTIES_TO_COMPARE_AND_STRINGIFY should ma
"writability",
"readability",
"readabilityParentFieldUniversalIdentifiers",
+ "sharingReach",
"isUICreatable",
"isSearchable",
"imageIdentifierFieldMetadataUniversalIdentifier",
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts
index db817bcd675..708c4f02e58 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/constant/all-entity-properties-configuration-by-metadata-name.constant.ts
@@ -281,6 +281,11 @@ export const ALL_ENTITY_PROPERTIES_CONFIGURATION_BY_METADATA_NAME = {
toStringify: true,
universalProperty: undefined,
},
+ sharingReach: {
+ toCompare: true,
+ toStringify: false,
+ universalProperty: undefined,
+ },
isUICreatable: {
toCompare: true,
toStringify: false,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-entity/types/__tests__/flat-entity-update.type-test.ts b/packages/twenty-server/src/engine/metadata-modules/flat-entity/types/__tests__/flat-entity-update.type-test.ts
index 4d42f2ae445..0cb6269befe 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-entity/types/__tests__/flat-entity-update.type-test.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-entity/types/__tests__/flat-entity-update.type-test.ts
@@ -63,6 +63,7 @@ type Assertions = [
| 'writability'
| 'readability'
| 'readabilityParentFieldUniversalIdentifiers'
+ | 'sharingReach'
>
>,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/__mocks__/get-flat-object-metadata.mock.ts b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/__mocks__/get-flat-object-metadata.mock.ts
index 1b00e348f1b..ecb43c99c4b 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/__mocks__/get-flat-object-metadata.mock.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/__mocks__/get-flat-object-metadata.mock.ts
@@ -2,6 +2,7 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
} from 'twenty-shared/types';
import { faker } from '@faker-js/faker';
import { TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER } from 'twenty-shared/application';
@@ -37,6 +38,7 @@ export const getFlatObjectMetadataMock = (
writability: MetadataWritability.OPEN,
readability: MetadataReadability.OPEN,
readabilityParentFieldUniversalIdentifiers: null,
+ sharingReach: ObjectSharingReach.WORKSPACE,
color: null,
id: faker.string.uuid(),
imageIdentifierFieldMetadataId,
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/constants/flat-object-metadata-editable-properties.constant.ts b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/constants/flat-object-metadata-editable-properties.constant.ts
index 9577f6e8c29..f586094545c 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/constants/flat-object-metadata-editable-properties.constant.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/constants/flat-object-metadata-editable-properties.constant.ts
@@ -16,6 +16,7 @@ export const FLAT_OBJECT_METADATA_EDITABLE_PROPERTIES = {
'labelIdentifierFieldMetadataId',
'imageIdentifierFieldMetadataId',
'readability',
+ 'sharingReach',
],
standard: [
'color',
@@ -27,6 +28,7 @@ export const FLAT_OBJECT_METADATA_EDITABLE_PROPERTIES = {
'labelPlural',
'labelSingular',
'imageIdentifierFieldMetadataId',
+ 'sharingReach',
],
} as const satisfies Record<
'standard' | 'custom',
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/from-create-object-input-to-flat-object-metadata-and-flat-field-metadatas-to-create.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/from-create-object-input-to-flat-object-metadata-and-flat-field-metadatas-to-create.util.ts
index 000bef8f85b..1da5fe05406 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/from-create-object-input-to-flat-object-metadata-and-flat-field-metadatas-to-create.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/from-create-object-input-to-flat-object-metadata-and-flat-field-metadatas-to-create.util.ts
@@ -3,6 +3,7 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
} from 'twenty-shared/types';
import {
capitalize,
@@ -78,6 +79,7 @@ export const fromCreateObjectInputToFlatObjectMetadataAndFlatFieldMetadatasToCre
writability: MetadataWritability.OPEN,
readability: MetadataReadability.OPEN,
readabilityParentFieldUniversalIdentifiers: null,
+ sharingReach: ObjectSharingReach.WORKSPACE,
isSystem: false,
labelPlural: capitalize(createObjectInput.labelPlural),
labelSingular: capitalize(createObjectInput.labelSingular),
diff --git a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/from-flat-object-metadata-to-object-metadata-dto.util.ts b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/from-flat-object-metadata-to-object-metadata-dto.util.ts
index 024bf6db6d3..73384adb4ce 100644
--- a/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/from-flat-object-metadata-to-object-metadata-dto.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/flat-object-metadata/utils/from-flat-object-metadata-to-object-metadata-dto.util.ts
@@ -1,3 +1,5 @@
+import { ObjectSharingReach } from 'twenty-shared/types';
+
import { type FlatObjectMetadata } from 'src/engine/metadata-modules/flat-object-metadata/types/flat-object-metadata.type';
import { type ObjectMetadataDTO } from 'src/engine/metadata-modules/object-metadata/dtos/object-metadata.dto';
import { resolveEffectiveFlatEntityProperty } from 'src/engine/metadata-modules/overrides/utils/resolve-effective-flat-entity-property.util';
@@ -22,6 +24,7 @@ export const fromFlatObjectMetadataToObjectMetadataDto = (
openRecordIn,
readability,
readabilityParentFieldUniversalIdentifiers,
+ sharingReach,
writability,
isSystem,
isUIEditable,
@@ -50,6 +53,9 @@ export const fromFlatObjectMetadataToObjectMetadataDto = (
openRecordIn,
readability,
readabilityParentFieldUniversalIdentifiers,
+ // Metadata cached before the column existed lacks it until recomputed,
+ // and the access policy treats that as staying within the role
+ sharingReach: sharingReach ?? ObjectSharingReach.WORKSPACE,
writability,
isSystem,
isUIEditable,
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/dtos/object-metadata.dto.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/dtos/object-metadata.dto.ts
index 3413a494c69..7c1024c51f9 100644
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/dtos/object-metadata.dto.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/object-metadata/dtos/object-metadata.dto.ts
@@ -9,6 +9,7 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
} from 'twenty-shared/types';
import { type AuthoredOverrides } from 'src/engine/metadata-modules/overrides/types/authored-overrides.type';
@@ -19,6 +20,7 @@ import { type ObjectMetadataOverrides } from 'src/engine/metadata-modules/object
registerEnumType(ObjectOpenRecordIn, { name: 'ObjectOpenRecordIn' });
registerEnumType(MetadataReadability, { name: 'MetadataReadability' });
registerEnumType(MetadataWritability, { name: 'MetadataWritability' });
+registerEnumType(ObjectSharingReach, { name: 'ObjectSharingReach' });
@ObjectType('Object')
export class ObjectMetadataDTO {
@@ -87,6 +89,9 @@ export class ObjectMetadataDTO {
@Field(() => [UUIDScalarType], { nullable: true })
readabilityParentFieldUniversalIdentifiers: string[] | null;
+
+ @Field(() => ObjectSharingReach)
+ sharingReach: ObjectSharingReach;
@Field(() => MetadataWritability)
writability: MetadataWritability;
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/dtos/update-object.input.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/dtos/update-object.input.ts
index bcf2adef9d8..70f25df42a1 100644
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/dtos/update-object.input.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/object-metadata/dtos/update-object.input.ts
@@ -1,7 +1,11 @@
import { Field, InputType } from '@nestjs/graphql';
import { Type } from 'class-transformer';
-import { MetadataReadability, ObjectOpenRecordIn } from 'twenty-shared/types';
+import {
+ MetadataReadability,
+ ObjectOpenRecordIn,
+ ObjectSharingReach,
+} from 'twenty-shared/types';
import {
IsBoolean,
IsEnum,
@@ -98,6 +102,11 @@ export class UpdateObjectPayload {
@Field(() => MetadataReadability, { nullable: true })
readability?: MetadataReadability;
+ @IsEnum(ObjectSharingReach)
+ @ValidateIf((_, value) => value !== undefined)
+ @Field(() => ObjectSharingReach, { nullable: true })
+ sharingReach?: ObjectSharingReach;
+
@Type(() => MetadataTranslationOverrideInput)
@ValidateNested({ each: true })
@IsOptional()
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.entity.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.entity.ts
index 24a32aafb2e..c0251f29cc9 100644
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.entity.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/object-metadata/object-metadata.entity.ts
@@ -14,8 +14,10 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
} from 'twenty-shared/types';
+import { ADD_OBJECT_METADATA_SHARING_REACH_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-45/add-object-metadata-sharing-reach-upgrade-command-name.constant';
import { ADD_METADATA_OVERRIDES_COLUMN_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-19/add-metadata-overrides-column-upgrade-command-name.constant';
import { ADD_METADATA_WRITABILITY_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-32/add-metadata-writability-upgrade-command-name.constant';
import { ADD_OBJECT_METADATA_OPEN_RECORD_IN_UPGRADE_COMMAND_NAME } from 'src/database/commands/upgrade-version-command/2-27/add-object-metadata-open-record-in-upgrade-command-name.constant';
@@ -175,6 +177,16 @@ export class ObjectMetadataEntity
@Column({ nullable: true, type: 'uuid', array: true })
readabilityParentFieldUniversalIdentifiers: string[] | null;
+ @WasIntroducedInUpgrade({
+ upgradeCommandName: ADD_OBJECT_METADATA_SHARING_REACH_UPGRADE_COMMAND_NAME,
+ })
+ @Column({
+ type: 'enum',
+ enum: Object.values(ObjectSharingReach),
+ default: ObjectSharingReach.WORKSPACE,
+ })
+ sharingReach: ObjectSharingReach;
+
@Column({ default: true })
isAuditLogged: boolean;
diff --git a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/from-object-metadata-entity-to-object-metadata-dto.util.ts b/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/from-object-metadata-entity-to-object-metadata-dto.util.ts
index 798def93c52..bd12a823032 100644
--- a/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/from-object-metadata-entity-to-object-metadata-dto.util.ts
+++ b/packages/twenty-server/src/engine/metadata-modules/object-metadata/utils/from-object-metadata-entity-to-object-metadata-dto.util.ts
@@ -1,3 +1,5 @@
+import { ObjectSharingReach } from 'twenty-shared/types';
+
import { type ObjectMetadataDTO } from 'src/engine/metadata-modules/object-metadata/dtos/object-metadata.dto';
import { type ObjectMetadataEntity } from 'src/engine/metadata-modules/object-metadata/object-metadata.entity';
import { readAuthoredOverrideProperty } from 'src/engine/metadata-modules/overrides/utils/read-authored-override-property.util';
@@ -42,6 +44,7 @@ export const fromObjectMetadataEntityToObjectMetadataDto = (
readability: entity.readability,
readabilityParentFieldUniversalIdentifiers:
entity.readabilityParentFieldUniversalIdentifiers,
+ sharingReach: entity.sharingReach ?? ObjectSharingReach.WORKSPACE,
writability: entity.writability,
isLabelSyncedWithName: entity.isLabelSyncedWithName,
workspaceId: entity.workspaceId,
diff --git a/packages/twenty-server/src/engine/subscriptions/object-record-event/__tests__/object-record-event-publisher.spec.ts b/packages/twenty-server/src/engine/subscriptions/object-record-event/__tests__/object-record-event-publisher.spec.ts
index 7435bc0f8b9..f427084a30f 100644
--- a/packages/twenty-server/src/engine/subscriptions/object-record-event/__tests__/object-record-event-publisher.spec.ts
+++ b/packages/twenty-server/src/engine/subscriptions/object-record-event/__tests__/object-record-event-publisher.spec.ts
@@ -432,6 +432,61 @@ describe('ObjectRecordEventPublisher', () => {
).not.toHaveBeenCalled();
});
+ it('publishes events of a record named for a subscriber whose role cannot read the object', async () => {
+ mockWorkspaceCacheService.getOrRecompute.mockImplementation(
+ createCacheMock({
+ rolesPermissions: {
+ [roleId]: {
+ [companyObjectMetadata.id]: {
+ ...mockRolesPermissions[roleId][companyObjectMetadata.id],
+ canReadObjectRecords: false,
+ },
+ },
+ },
+ featureFlagsMap: {
+ [FeatureFlagKey.IS_RECORD_LEVEL_SHARING_ENABLED]: true,
+ },
+ }),
+ );
+ mockRecordShareStorageService.findByRecordIds.mockResolvedValue([
+ {
+ id: 'record-share-1',
+ recordId: 'record-1',
+ objectMetadataId: companyObjectMetadata.id,
+ principalId: 'test-workspace-member-id',
+ principalType: RecordSharePrincipalType.WORKSPACE_MEMBER,
+ accessLevel: RecordShareAccessLevel.READ,
+ rowCause: RecordShareRowCause.MANUAL,
+ sourceId: 'record-1',
+ },
+ ] as RecordShare[]);
+
+ await service.publish({
+ name: 'company.created',
+ workspaceId,
+ objectMetadata: companyObjectMetadata,
+ events: [
+ createMockEvent(),
+ createMockEvent({
+ recordId: 'record-2',
+ properties: { after: { id: 'record-2', name: 'Hidden Company' } },
+ }),
+ ],
+ } as WorkspaceEventBatch<never>);
+
+ expect(mockSubscriptionService.publishToEventStream).toHaveBeenCalled();
+ const publishCall = (
+ mockSubscriptionService.publishToEventStream as jest.Mock
+ ).mock.calls[0][0];
+
+ expect(
+ publishCall.payload.objectRecordEventsWithQueryIds.map(
+ (matchedEvent: { objectRecordEvent: { recordId: string } }) =>
+ matchedEvent.objectRecordEvent.recordId,
+ ),
+ ).toEqual(['record-1']);
+ });
+
it('should not publish events when query object name does not match event', async () => {
const streamDataWithDifferentObject: EventStreamData = {
...mockStreamData,
diff --git a/packages/twenty-server/src/engine/subscriptions/object-record-event/object-record-event-publisher.ts b/packages/twenty-server/src/engine/subscriptions/object-record-event/object-record-event-publisher.ts
index 368e0226125..cea1e7f1fd8 100644
--- a/packages/twenty-server/src/engine/subscriptions/object-record-event/object-record-event-publisher.ts
+++ b/packages/twenty-server/src/engine/subscriptions/object-record-event/object-record-event-publisher.ts
@@ -6,6 +6,7 @@ import {
} from 'twenty-shared/constants';
import { type ObjectRecordEvent } from 'twenty-shared/database-events';
import {
+ FeatureFlagKey,
Nullable,
ObjectRecord,
type ObjectsPermissions,
@@ -38,6 +39,7 @@ import { type FlatRowLevelPermissionPredicateGroupMaps } from 'src/engine/metada
import { type FlatRowLevelPermissionPredicateMaps } from 'src/engine/metadata-modules/row-level-permission-predicate/types/flat-row-level-permission-predicate-maps.type';
import { RecordAccessPolicyService } from 'src/engine/core-modules/record-share/services/record-access-policy.service';
import { type EventRecordAccessGate } from 'src/engine/core-modules/record-share/types/event-record-access-gate.type';
+import { isRecordGrantBeyondRoleAllowed } from 'src/engine/core-modules/record-share/utils/is-record-grant-beyond-role-allowed.util';
import { omitInheritedReadabilityChildRecords } from 'src/engine/core-modules/record-share/utils/omit-inherited-readability-child-records.util';
import { omitRestrictedFieldsFromEvent } from 'src/engine/core-modules/record-share/utils/omit-restricted-fields-from-event.util';
import { EventStreamService } from 'src/engine/subscriptions/event-stream.service';
@@ -65,6 +67,7 @@ type StreamPermissionsContext = {
userWorkspaceRoleMap: UserWorkspaceRoleMap;
rolesPermissions: ObjectsPermissionsByRoleId;
flatApplicationMaps: FlatApplicationCacheMaps;
+ isRecordSharingEnabled: boolean;
};
@Injectable()
@@ -184,8 +187,15 @@ export class ObjectRecordEventPublisher {
const objectPermissions =
objectsPermissions[workspaceEventBatch.objectMetadata.id];
+ // The access gate then admits only the records named for the subscriber
+ // beyond their role and row filter
+ const isGrantBeyondRoleAllowed = isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: workspaceEventBatch.objectMetadata,
+ operationType: 'select',
+ isRecordSharingEnabled: permissionsContext.isRecordSharingEnabled,
+ });
- if (!objectPermissions?.canReadObjectRecords) {
+ if (!objectPermissions?.canReadObjectRecords && !isGrantBeyondRoleAllowed) {
return;
}
@@ -214,13 +224,15 @@ export class ObjectRecordEventPublisher {
}),
};
- const subscriberRLSFilter = this.buildSubscriberRLSFilter(
- subscriberAuthContext,
- roleIds,
- workspaceEventBatch.objectMetadata,
- permissionsContext,
- flatWorkspaceMemberMaps,
- );
+ const subscriberRLSFilter = isGrantBeyondRoleAllowed
+ ? null
+ : this.buildSubscriberRLSFilter(
+ subscriberAuthContext,
+ roleIds,
+ workspaceEventBatch.objectMetadata,
+ permissionsContext,
+ flatWorkspaceMemberMaps,
+ );
const admittedRecordIds =
await eventRecordAccessGate.resolveAdmittedRecordIds(
@@ -233,7 +245,7 @@ export class ObjectRecordEventPublisher {
}),
);
- const restrictedFields = objectPermissions.restrictedFields;
+ const restrictedFields = objectPermissions?.restrictedFields ?? {};
for (const event of workspaceEventBatch.events) {
const { action } = parseEventNameOrThrow(workspaceEventBatch.name);
@@ -677,6 +689,7 @@ export class ObjectRecordEventPublisher {
userWorkspaceRoleMap,
rolesPermissions,
flatApplicationMaps,
+ featureFlagsMap,
} = await this.workspaceCacheService.getOrRecompute(workspaceId, [
'flatRowLevelPermissionPredicateMaps',
'flatRowLevelPermissionPredicateGroupMaps',
@@ -684,6 +697,7 @@ export class ObjectRecordEventPublisher {
'userWorkspaceRoleMap',
'rolesPermissions',
'flatApplicationMaps',
+ 'featureFlagsMap',
]);
return {
@@ -693,6 +707,9 @@ export class ObjectRecordEventPublisher {
userWorkspaceRoleMap,
rolesPermissions,
flatApplicationMaps,
+ isRecordSharingEnabled:
+ featureFlagsMap[FeatureFlagKey.IS_RECORD_LEVEL_SHARING_ENABLED] ??
+ false,
};
}
}
diff --git a/packages/twenty-server/src/engine/twenty-orm/query-builder/workspace-select-query-builder.ts b/packages/twenty-server/src/engine/twenty-orm/query-builder/workspace-select-query-builder.ts
index 596f4ae4ac9..f5b1df8fad2 100644
--- a/packages/twenty-server/src/engine/twenty-orm/query-builder/workspace-select-query-builder.ts
+++ b/packages/twenty-server/src/engine/twenty-orm/query-builder/workspace-select-query-builder.ts
@@ -67,6 +67,7 @@ export type QueryBuilderContext = {
tableShape: WorkspaceTableShape;
executor: QueryExecutor;
objectRecordsPermissions: ObjectsPermissions;
+ isRecordSharingEnabled?: boolean;
tableShapeByObjectMetadataId: (
objectMetadataId: string,
) => WorkspaceTableShape;
@@ -78,6 +79,7 @@ export class WorkspaceSelectQueryBuilder implements WhereExpressionLike {
readonly alias: string;
readonly tableShape: WorkspaceTableShape;
readonly objectRecordsPermissions: ObjectsPermissions;
+ readonly isRecordSharingEnabled: boolean;
private readonly context: QueryBuilderContext;
private readonly whereClauses: WhereClause[] = [];
@@ -100,6 +102,7 @@ export class WorkspaceSelectQueryBuilder implements WhereExpressionLike {
this.alias = alias;
this.tableShape = context.tableShape;
this.objectRecordsPermissions = context.objectRecordsPermissions;
+ this.isRecordSharingEnabled = context.isRecordSharingEnabled ?? false;
this.context = context;
}
diff --git a/packages/twenty-server/src/engine/twenty-orm/repository/permissions.utils.ts b/packages/twenty-server/src/engine/twenty-orm/repository/permissions.utils.ts
index bab38ceffb6..ff4e7a179fc 100644
--- a/packages/twenty-server/src/engine/twenty-orm/repository/permissions.utils.ts
+++ b/packages/twenty-server/src/engine/twenty-orm/repository/permissions.utils.ts
@@ -19,6 +19,7 @@ import {
import { type WorkspaceAuthContext } from 'src/engine/core-modules/auth/types/workspace-auth-context.type';
import { validateWritabilityOrThrow } from 'src/engine/twenty-orm/repository/validate-writability-or-throw.util';
import { isObjectOperationPermitted } from 'src/engine/twenty-orm/utils/is-object-operation-permitted.util';
+import { isRecordGrantBeyondRoleAllowed } from 'src/engine/core-modules/record-share/utils/is-record-grant-beyond-role-allowed.util';
import { getColumnNameToFieldMetadataIdMap } from 'src/engine/twenty-orm/utils/get-column-name-to-field-metadata-id.util';
export type OperationType =
@@ -40,6 +41,7 @@ type ValidateOperationIsPermittedOrThrowArgs = {
allFieldsSelected: boolean;
updatedColumns: string[];
authContext?: WorkspaceAuthContext;
+ isRecordSharingEnabled?: boolean;
};
export const validateOperationIsPermittedOrThrow = ({
@@ -53,6 +55,7 @@ export const validateOperationIsPermittedOrThrow = ({
allFieldsSelected,
updatedColumns,
authContext,
+ isRecordSharingEnabled = false,
}: ValidateOperationIsPermittedOrThrowArgs) => {
const objectMetadataIdForEntity = objectIdByNameSingular[entityName];
@@ -91,12 +94,19 @@ export const validateOperationIsPermittedOrThrow = ({
const permissionsForEntity = objectsPermissions[objectMetadataIdForEntity];
+ // Records shared by name stay reachable without the object permission; the
+ // row access policy then narrows the query to those records
if (
- !isDefined(permissionsForEntity) ||
- !isObjectOperationPermitted({
- objectMetadata,
+ (!isDefined(permissionsForEntity) ||
+ !isObjectOperationPermitted({
+ objectMetadata,
+ operationType,
+ objectsPermissions,
+ })) &&
+ !isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: objectMetadata,
operationType,
- objectsPermissions,
+ isRecordSharingEnabled,
})
) {
throw new PermissionsException(
@@ -105,10 +115,12 @@ export const validateOperationIsPermittedOrThrow = ({
);
}
+ const restrictedFields = permissionsForEntity?.restrictedFields ?? {};
+
switch (operationType) {
case 'select':
validateReadFieldPermissionOrThrow({
- restrictedFields: permissionsForEntity.restrictedFields,
+ restrictedFields,
selectedColumns,
columnNameToFieldMetadataIdMap,
allFieldsSelected,
@@ -118,7 +130,7 @@ export const validateOperationIsPermittedOrThrow = ({
break;
case 'insert':
validateReadFieldPermissionOrThrow({
- restrictedFields: permissionsForEntity.restrictedFields,
+ restrictedFields,
selectedColumns,
columnNameToFieldMetadataIdMap,
entityName,
@@ -127,7 +139,7 @@ export const validateOperationIsPermittedOrThrow = ({
if (updatedColumns.length > 0) {
const rlsFieldMetadataIds = new Set(
- permissionsForEntity.rowLevelPermissionPredicates.map(
+ (permissionsForEntity?.rowLevelPermissionPredicates ?? []).map(
(predicate) => predicate.fieldMetadataId,
),
);
@@ -139,7 +151,7 @@ export const validateOperationIsPermittedOrThrow = ({
if (updatedColumnsWithoutRlsFields.length > 0) {
validateUpdateFieldPermissionOrThrow({
- restrictedFields: permissionsForEntity.restrictedFields,
+ restrictedFields,
updatedColumns: updatedColumnsWithoutRlsFields,
columnNameToFieldMetadataIdMap,
entityName,
@@ -150,7 +162,7 @@ export const validateOperationIsPermittedOrThrow = ({
break;
case 'update':
validateReadFieldPermissionOrThrow({
- restrictedFields: permissionsForEntity.restrictedFields,
+ restrictedFields,
selectedColumns,
columnNameToFieldMetadataIdMap,
entityName,
@@ -159,7 +171,7 @@ export const validateOperationIsPermittedOrThrow = ({
if (updatedColumns.length > 0) {
validateUpdateFieldPermissionOrThrow({
- restrictedFields: permissionsForEntity.restrictedFields,
+ restrictedFields,
updatedColumns,
columnNameToFieldMetadataIdMap,
entityName,
@@ -169,7 +181,7 @@ export const validateOperationIsPermittedOrThrow = ({
break;
case 'delete':
validateReadFieldPermissionOrThrow({
- restrictedFields: permissionsForEntity.restrictedFields,
+ restrictedFields,
selectedColumns,
columnNameToFieldMetadataIdMap,
entityName,
@@ -179,7 +191,7 @@ export const validateOperationIsPermittedOrThrow = ({
case 'restore':
case 'soft-delete':
validateReadFieldPermissionOrThrow({
- restrictedFields: permissionsForEntity.restrictedFields,
+ restrictedFields,
selectedColumns,
columnNameToFieldMetadataIdMap,
entityName,
@@ -193,7 +205,7 @@ export const validateOperationIsPermittedOrThrow = ({
);
}
- if (isEmpty(permissionsForEntity.restrictedFields)) {
+ if (isEmpty(restrictedFields)) {
return;
}
};
diff --git a/packages/twenty-server/src/engine/twenty-orm/repository/workspace-repository.ts b/packages/twenty-server/src/engine/twenty-orm/repository/workspace-repository.ts
index d71dfb736c4..19e985259e5 100644
--- a/packages/twenty-server/src/engine/twenty-orm/repository/workspace-repository.ts
+++ b/packages/twenty-server/src/engine/twenty-orm/repository/workspace-repository.ts
@@ -43,6 +43,8 @@ import {
} from 'src/engine/twenty-orm/types/row-access-policy.type';
import { resolveRecordShareGateKind } from 'src/engine/core-modules/record-share/utils/resolve-record-share-gate-kind.util';
import { buildRowAccessPolicy } from 'src/engine/twenty-orm/utils/build-row-access-policy.util';
+import { buildNamedRecordGrantCondition } from 'src/engine/core-modules/record-share/utils/build-named-record-grant-condition.util';
+import { isRecordGrantBeyondRoleAllowed } from 'src/engine/core-modules/record-share/utils/is-record-grant-beyond-role-allowed.util';
import { isObjectOperationPermitted } from 'src/engine/twenty-orm/utils/is-object-operation-permitted.util';
import { formatData } from 'src/engine/twenty-orm/utils/format-data.util';
import { formatResult } from 'src/engine/twenty-orm/utils/format-result.util';
@@ -184,6 +186,7 @@ export class WorkspaceRepository<TEntity extends ObjectLiteral = ObjectRecord> {
tableShape: this.options.tableShape,
executor: this.options.executor,
objectRecordsPermissions: this.options.objectRecordsPermissions,
+ isRecordSharingEnabled: this.isRecordSharingEnabled,
tableShapeByObjectMetadataId: this.options.tableShapeByObjectMetadataId,
onBeforeExecute: (queryBuilder) => this.onBeforeExecute(queryBuilder),
formatResult: (records) => this.formatResult(records),
@@ -1195,25 +1198,32 @@ export class WorkspaceRepository<TEntity extends ObjectLiteral = ObjectRecord> {
),
});
- for (const [index, input] of writableInputs.entries()) {
- const { id: _id, ...setColumns } = this.formatWriteData(
- dataByInputIndex[index],
- );
+ const setColumnsByInputIndex = writtenRecords.map(
+ ({ id: _id, ...setColumns }) => setColumns,
+ );
+ for (const setColumns of setColumnsByInputIndex) {
this.validateWriteIsPermitted({
operationType: 'update',
columnsToReturn,
updatedColumns: Object.keys(setColumns),
});
+ }
- const rawBeforeForInput = rawBeforeByInputIndex[index];
-
- this.validateRLSPredicatesForWrittenRecords(
- this.formatResult<ObjectRecord[]>(
- rawBeforeForInput.map((record) => ({ ...record, ...setColumns })),
+ await this.validateRLSPredicatesForUpdatedRecords(
+ this.formatResult<ObjectRecord[]>(
+ setColumnsByInputIndex.flatMap((setColumns, index) =>
+ rawBeforeByInputIndex[index].map((record) => ({
+ ...record,
+ ...setColumns,
+ })),
),
- 'Updated record does not satisfy row-level security constraints of your current role',
- );
+ ),
+ );
+
+ for (const [index, input] of writableInputs.entries()) {
+ const setColumns = setColumnsByInputIndex[index];
+ const rawBeforeForInput = rawBeforeByInputIndex[index];
const selectQueryBuilder = this.createQueryBuilder().where({
id: input.id,
@@ -1439,6 +1449,7 @@ export class WorkspaceRepository<TEntity extends ObjectLiteral = ObjectRecord> {
tableShape: this.options.tableShape,
executor: this.options.executor,
objectRecordsPermissions: this.options.objectRecordsPermissions,
+ isRecordSharingEnabled: this.isRecordSharingEnabled,
tableShapeByObjectMetadataId: this.options.tableShapeByObjectMetadataId,
onBeforeExecute: () => undefined,
formatResult: (records) => this.formatResult(records),
@@ -1686,11 +1697,10 @@ export class WorkspaceRepository<TEntity extends ObjectLiteral = ObjectRecord> {
}
if (kind === 'update' && isDefined(setColumns)) {
- this.validateRLSPredicatesForWrittenRecords(
+ await this.validateRLSPredicatesForUpdatedRecords(
this.formatResult<ObjectRecord[]>(
recordsBefore.map((record) => ({ ...record, ...setColumns })),
),
- 'Updated record does not satisfy row-level security constraints of your current role',
);
}
@@ -1894,9 +1904,75 @@ export class WorkspaceRepository<TEntity extends ObjectLiteral = ObjectRecord> {
allFieldsSelected: false,
updatedColumns,
authContext: this.options.authContext,
+ isRecordSharingEnabled: this.isRecordSharingEnabled,
});
}
+ // A record shared by name for editing stays editable whatever the row
+ // filter of the role says, as the row access policy let it through
+ private async validateRLSPredicatesForUpdatedRecords(
+ records: ObjectRecord[],
+ ): Promise<void> {
+ const recordIdsGrantedForUpdate =
+ await this.findRecordIdsGrantedForUpdateByName(
+ records.map((record) => record.id).filter(isDefined),
+ );
+
+ this.validateRLSPredicatesForWrittenRecords(
+ records.filter(
+ (record) =>
+ !isDefined(record.id) || !recordIdsGrantedForUpdate.has(record.id),
+ ),
+ 'Updated record does not satisfy row-level security constraints of your current role',
+ );
+ }
+
+ private async findRecordIdsGrantedForUpdateByName(
+ recordIds: string[],
+ ): Promise<Set<string>> {
+ if (
+ this.options.shouldBypassPermissionChecks ||
+ recordIds.length === 0 ||
+ !isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: this.options.flatObjectMetadata,
+ operationType: 'update',
+ isRecordSharingEnabled: this.isRecordSharingEnabled,
+ })
+ ) {
+ return new Set();
+ }
+
+ const tableAlias = this.options.tableShape.nameSingular;
+ const namedRecordGrantCondition = buildNamedRecordGrantCondition(
+ {
+ subject: this.resolveRowAccessPolicySubject(),
+ environment: this.resolveRowAccessPolicyEnvironment(),
+ },
+ {
+ tableAlias,
+ flatObjectMetadata: this.options.flatObjectMetadata,
+ operationType: 'update',
+ depth: 0,
+ },
+ );
+
+ if (!isDefined(namedRecordGrantCondition)) {
+ return new Set();
+ }
+
+ const grantedRecords = await this.buildIdsEventSnapshotQueryBuilder(
+ recordIds,
+ )
+ .select(['id'])
+ .andWhere(
+ namedRecordGrantCondition.sql,
+ namedRecordGrantCondition.parameters,
+ )
+ .getMany<ObjectRecord>({ noFormatting: true });
+
+ return new Set(grantedRecords.map((record) => String(record.id)));
+ }
+
private validateRLSPredicatesForWrittenRecords(
records: ObjectRecord[],
errorMessage?: string,
@@ -1991,6 +2067,7 @@ export class WorkspaceRepository<TEntity extends ObjectLiteral = ObjectRecord> {
this.options.internalContext.flatFieldMetadataMaps,
objectIdByNameSingular:
this.options.internalContext.objectIdByNameSingular,
+ isRecordSharingEnabled: this.isRecordSharingEnabled,
selectedColumns: columnNames,
allFieldsSelected: false,
updatedColumns: [],
@@ -2048,7 +2125,12 @@ export class WorkspaceRepository<TEntity extends ObjectLiteral = ObjectRecord> {
if (
alias === queryBuilder.alias &&
- !this.isObjectOperationPermitted({ flatObjectMetadata, operationType })
+ !this.isObjectOperationPermitted({ flatObjectMetadata, operationType }) &&
+ !isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata,
+ operationType,
+ isRecordSharingEnabled: this.isRecordSharingEnabled,
+ })
) {
throw new PermissionsException(
PermissionsExceptionMessage.PERMISSION_DENIED,
@@ -2087,6 +2169,18 @@ export class WorkspaceRepository<TEntity extends ObjectLiteral = ObjectRecord> {
}
}
+ // Whether the role alone permits the operation, regardless of any record
+ // grant that may reach beyond it
+ isObjectOperationPermittedByRole(operationType: OperationType): boolean {
+ return (
+ this.options.shouldBypassPermissionChecks ||
+ this.isObjectOperationPermitted({
+ flatObjectMetadata: this.options.flatObjectMetadata,
+ operationType,
+ })
+ );
+ }
+
private isObjectOperationPermitted({
flatObjectMetadata,
operationType,
@@ -2167,13 +2261,18 @@ export class WorkspaceRepository<TEntity extends ObjectLiteral = ObjectRecord> {
),
resolveTableExpression: (objectMetadataId) =>
this.getTableExpression(objectMetadataId),
- isRecordSharingEnabled:
- this.options.internalContext.featureFlagsMap[
- FeatureFlagKey.IS_RECORD_LEVEL_SHARING_ENABLED
- ] ?? false,
+ isRecordSharingEnabled: this.isRecordSharingEnabled,
};
}
+ private get isRecordSharingEnabled(): boolean {
+ return (
+ this.options.internalContext.featureFlagsMap[
+ FeatureFlagKey.IS_RECORD_LEVEL_SHARING_ENABLED
+ ] ?? false
+ );
+ }
+
private resolveInheritedReadabilityParents(
flatObjectMetadata: FlatObjectMetadata,
): InheritedReadabilityParent[] {
diff --git a/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/build-row-access-policy.util.spec.ts b/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/build-row-access-policy.util.spec.ts
index 2b4c481a702..4ea43ff4df1 100644
--- a/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/build-row-access-policy.util.spec.ts
+++ b/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/build-row-access-policy.util.spec.ts
@@ -1,4 +1,10 @@
-import { MetadataReadability, MetadataWritability } from 'twenty-shared/types';
+import { EVERYONE_PRINCIPAL_ID } from 'twenty-shared/constants';
+import {
+ MetadataReadability,
+ MetadataWritability,
+ ObjectSharingReach,
+ RecordShareAccessLevel,
+} from 'twenty-shared/types';
import { getFlatObjectMetadataMock } from 'src/engine/metadata-modules/flat-object-metadata/__mocks__/get-flat-object-metadata.mock';
import { type FlatObjectMetadata } from 'src/engine/metadata-modules/flat-object-metadata/types/flat-object-metadata.type';
@@ -198,6 +204,113 @@ describe('buildRowAccessPolicy', () => {
).toEqual({ kind: 'open' });
});
+ describe('with a record shared beyond the role', () => {
+ const sharingEnvironment = { ...environment, isRecordSharingEnabled: true };
+ const company = buildObject({
+ id: 'company',
+ readability: MetadataReadability.OPEN,
+ });
+ const buildForCompany = (
+ subject: RowAccessPolicySubject,
+ operationType: 'select' | 'update' | 'delete' = 'select',
+ ) =>
+ buildRowAccessPolicy({
+ subject,
+ environment: sharingEnvironment,
+ tableAlias: 'company',
+ flatObjectMetadata: company,
+ operationType,
+ depth: 0,
+ });
+ const withoutObjectPermission: RowAccessPolicySubject = {
+ ...readEverything,
+ principalIds: ['role-2', 'member-1', 'role-1'],
+ objectsPermissions: {},
+ };
+
+ it('narrows a subject without object permission to the records named for them', () => {
+ const policy = buildForCompany(withoutObjectPermission);
+
+ expect(policy.kind).toBe('gated');
+ if (policy.kind !== 'gated') throw new Error('Expected a grant gate');
+ expect(policy.condition.sql).toMatch(
+ /^"company"."id" = ANY\(ARRAY\(SELECT "company_recordShare"."recordId" FROM "workspace"."recordShare"/,
+ );
+ expect(Object.values(policy.condition.parameters)).toContainEqual([
+ 'role-2',
+ 'member-1',
+ 'role-1',
+ ]);
+ });
+
+ it('narrows edits of a subject without object permission to the records named for editing', () => {
+ const policy = buildForCompany(withoutObjectPermission, 'update');
+
+ if (policy.kind !== 'gated') throw new Error('Expected a grant gate');
+ expect(Object.values(policy.condition.parameters)).toEqual(
+ expect.arrayContaining([
+ ['role-2', 'member-1', 'role-1'],
+ [RecordShareAccessLevel.READ_WRITE, RecordShareAccessLevel.FULL],
+ ]),
+ );
+ });
+
+ it('never lets general access reach beyond the role', () => {
+ const policy = buildForCompany({
+ ...withoutObjectPermission,
+ principalIds: [EVERYONE_PRINCIPAL_ID, 'member-1'],
+ });
+
+ if (policy.kind !== 'gated') throw new Error('Expected a grant gate');
+ expect(Object.values(policy.condition.parameters)).toContainEqual([
+ 'member-1',
+ ]);
+ });
+
+ it('keeps deletion with the role', () => {
+ expect(buildForCompany(withoutObjectPermission, 'delete')).toEqual({
+ kind: 'denied',
+ });
+ });
+
+ it('denies a subject named nowhere', () => {
+ expect(
+ buildForCompany({
+ ...withoutObjectPermission,
+ principalIds: [EVERYONE_PRINCIPAL_ID],
+ }),
+ ).toEqual({ kind: 'denied' });
+ });
+
+ it('lets a named grant bypass the row filter of the role', () => {
+ const policy = buildForCompany({
+ ...readEverything,
+ resolveRowLevelPermissionRecordFilter: () => NOTE_FILTER,
+ });
+
+ if (policy.kind !== 'gated') throw new Error('Expected a grant gate');
+ expect(policy.condition.sql).toMatch(
+ /^\(\(\("company"."title" = :restricted\) AND \(NOT EXISTS .*\)\) OR \("company"."id" = ANY\(ARRAY\(SELECT "company_recordShare"."recordId"/,
+ );
+ });
+
+ it('keeps the role limits when the object restricts sharing to the role', () => {
+ expect(
+ buildRowAccessPolicy({
+ subject: withoutObjectPermission,
+ environment: sharingEnvironment,
+ tableAlias: 'company',
+ flatObjectMetadata: {
+ ...company,
+ sharingReach: ObjectSharingReach.ROLE_ACCESS,
+ },
+ operationType: 'select',
+ depth: 0,
+ }),
+ ).toEqual({ kind: 'denied' });
+ });
+ });
+
it('denies an object the subject has no permission on', () => {
expect(build({ ...readEverything, objectsPermissions: {} }, note)).toEqual({
kind: 'denied',
diff --git a/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/get-column-name-to-field-metadata-id.util.spec.ts b/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/get-column-name-to-field-metadata-id.util.spec.ts
index cd3873b9e94..d8fc0251d57 100644
--- a/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/get-column-name-to-field-metadata-id.util.spec.ts
+++ b/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/get-column-name-to-field-metadata-id.util.spec.ts
@@ -3,6 +3,7 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
} from 'twenty-shared/types';
import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
@@ -50,6 +51,7 @@ describe('getColumnNameToFieldMetadataIdMap', () => {
writability: MetadataWritability.OPEN,
readability: MetadataReadability.OPEN,
readabilityParentFieldUniversalIdentifiers: null,
+ sharingReach: ObjectSharingReach.WORKSPACE,
openRecordIn: ObjectOpenRecordIn.USER_CHOICE,
labelIdentifierFieldMetadataId: null,
imageIdentifierFieldMetadataId: null,
diff --git a/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/get-field-metadata-id-to-column-names-map.util.spec.ts b/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/get-field-metadata-id-to-column-names-map.util.spec.ts
index 8db49764ebd..a42ff80f6af 100644
--- a/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/get-field-metadata-id-to-column-names-map.util.spec.ts
+++ b/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/get-field-metadata-id-to-column-names-map.util.spec.ts
@@ -3,6 +3,7 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
} from 'twenty-shared/types';
import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
@@ -50,6 +51,7 @@ describe('getFieldMetadataIdToColumnNamesMap', () => {
writability: MetadataWritability.OPEN,
readability: MetadataReadability.OPEN,
readabilityParentFieldUniversalIdentifiers: null,
+ sharingReach: ObjectSharingReach.WORKSPACE,
openRecordIn: ObjectOpenRecordIn.USER_CHOICE,
labelIdentifierFieldMetadataId: null,
imageIdentifierFieldMetadataId: null,
diff --git a/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/is-record-matching-rls-row-level-permission-predicate.util.spec.ts b/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/is-record-matching-rls-row-level-permission-predicate.util.spec.ts
index b6b0bf4e9b9..d971b33d86e 100644
--- a/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/is-record-matching-rls-row-level-permission-predicate.util.spec.ts
+++ b/packages/twenty-server/src/engine/twenty-orm/utils/__tests__/is-record-matching-rls-row-level-permission-predicate.util.spec.ts
@@ -3,8 +3,9 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
- type RecordGqlOperationFilter,
type ObjectRecord,
+ ObjectSharingReach,
+ type RecordGqlOperationFilter,
} from 'twenty-shared/types';
import { type FlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/types/flat-entity-maps.type';
@@ -53,6 +54,7 @@ describe('isRecordMatchingRLSRowLevelPermissionPredicate', () => {
writability: MetadataWritability.OPEN,
readability: MetadataReadability.OPEN,
readabilityParentFieldUniversalIdentifiers: null,
+ sharingReach: ObjectSharingReach.WORKSPACE,
openRecordIn: ObjectOpenRecordIn.USER_CHOICE,
labelIdentifierFieldMetadataId: null,
imageIdentifierFieldMetadataId: null,
diff --git a/packages/twenty-server/src/engine/twenty-orm/utils/build-row-access-policy.util.ts b/packages/twenty-server/src/engine/twenty-orm/utils/build-row-access-policy.util.ts
index e495f020972..8b2fc53fa85 100644
--- a/packages/twenty-server/src/engine/twenty-orm/utils/build-row-access-policy.util.ts
+++ b/packages/twenty-server/src/engine/twenty-orm/utils/build-row-access-policy.util.ts
@@ -1,7 +1,9 @@
import { isMetadataWritePermitted } from 'src/engine/twenty-orm/utils/is-metadata-write-permitted.util';
import { isDefined } from 'twenty-shared/utils';
+import { buildNamedRecordGrantCondition } from 'src/engine/core-modules/record-share/utils/build-named-record-grant-condition.util';
import { buildRecordShareGate } from 'src/engine/core-modules/record-share/utils/build-record-share-gate.util';
+import { isRecordGrantBeyondRoleAllowed } from 'src/engine/core-modules/record-share/utils/is-record-grant-beyond-role-allowed.util';
import {
type RowAccessPolicy,
type RowAccessPolicyContext,
@@ -36,6 +38,14 @@ export const buildRowAccessPolicy = ({
return { kind: 'denied' };
}
+ const namedRecordGrantCondition = isRecordGrantBeyondRoleAllowed({
+ flatObjectMetadata: target.flatObjectMetadata,
+ operationType: target.operationType,
+ isRecordSharingEnabled: environment.isRecordSharingEnabled,
+ })
+ ? buildNamedRecordGrantCondition(context, target)
+ : undefined;
+
if (
isDefined(subject.objectsPermissions) &&
!isObjectOperationPermitted({
@@ -44,7 +54,9 @@ export const buildRowAccessPolicy = ({
objectsPermissions: subject.objectsPermissions,
})
) {
- return { kind: 'denied' };
+ return isDefined(namedRecordGrantCondition)
+ ? { kind: 'gated', condition: namedRecordGrantCondition }
+ : { kind: 'denied' };
}
const recordShareGate = buildRecordShareGate({
@@ -58,8 +70,9 @@ export const buildRowAccessPolicy = ({
return { kind: 'denied' };
}
+ const rolePredicate = buildRolePredicate(context, target);
const conditions = [
- buildRolePredicate(context, target),
+ rolePredicate,
recordShareGate.kind === 'gated' ? recordShareGate.condition : undefined,
].filter(isDefined);
@@ -67,6 +80,18 @@ export const buildRowAccessPolicy = ({
return { kind: 'open' };
}
+ // The share gate already admits named grants, so only a role predicate
+ // keeps one out and needs the grant as an alternative
+ if (isDefined(rolePredicate) && isDefined(namedRecordGrantCondition)) {
+ return {
+ kind: 'gated',
+ condition: combineSqlConditions(
+ [combineSqlConditions(conditions), namedRecordGrantCondition],
+ 'OR',
+ ),
+ };
+ }
+
return { kind: 'gated', condition: combineSqlConditions(conditions) };
};
diff --git a/packages/twenty-server/src/engine/twenty-orm/utils/combine-sql-conditions.util.ts b/packages/twenty-server/src/engine/twenty-orm/utils/combine-sql-conditions.util.ts
index 955dd6f8a35..4481675e175 100644
--- a/packages/twenty-server/src/engine/twenty-orm/utils/combine-sql-conditions.util.ts
+++ b/packages/twenty-server/src/engine/twenty-orm/utils/combine-sql-conditions.util.ts
@@ -2,10 +2,17 @@ import { type SqlCondition } from 'src/engine/twenty-orm/types/row-access-policy
export const combineSqlConditions = (
conditions: SqlCondition[],
-): SqlCondition => ({
- sql: conditions.map((condition) => `(${condition.sql})`).join(' AND '),
- parameters: Object.assign(
- {},
- ...conditions.map((condition) => condition.parameters),
- ),
-});
+ operator: 'AND' | 'OR' = 'AND',
+): SqlCondition => {
+ const sql = conditions
+ .map((condition) => `(${condition.sql})`)
+ .join(` ${operator} `);
+
+ return {
+ sql: operator === 'OR' ? `(${sql})` : sql,
+ parameters: Object.assign(
+ {},
+ ...conditions.map((condition) => condition.parameters),
+ ),
+ };
+};
diff --git a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-object-flat-metadata.util.ts b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-object-flat-metadata.util.ts
index 3aecc12eb94..5bfbfa4389a 100644
--- a/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-object-flat-metadata.util.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/twenty-standard-application/utils/object-metadata/create-standard-object-flat-metadata.util.ts
@@ -3,6 +3,7 @@ import {
MetadataReadability,
MetadataWritability,
ObjectOpenRecordIn,
+ ObjectSharingReach,
} from 'twenty-shared/types';
import { TWENTY_STANDARD_APPLICATION_UNIVERSAL_IDENTIFIER } from 'twenty-shared/application';
import { isDefined } from 'twenty-shared/utils';
@@ -134,6 +135,7 @@ export const createStandardObjectFlatMetadata = <
writability,
readability,
readabilityParentFieldUniversalIdentifiers,
+ sharingReach: ObjectSharingReach.WORKSPACE,
openRecordIn,
isLabelSyncedWithName: false,
overrides: null,
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/__tests__/universal-flat-entity-update.test-type.ts b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/__tests__/universal-flat-entity-update.test-type.ts
index d548a7b01b0..3209ac87aac 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/__tests__/universal-flat-entity-update.test-type.ts
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/universal-flat-entity/types/__tests__/universal-flat-entity-update.test-type.ts
@@ -48,6 +48,7 @@ type Assertions = [
| 'writability'
| 'readability'
| 'readabilityParentFieldUniversalIdentifiers'
+ | 'sharingReach'
>
>,
];
diff --git a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/universal-flat-entity/utils/__tests__/__snapshots__/delete-flat-entity-foreign-key-aggregators.util.spec.ts.snap b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/universal-flat-entity/utils/__tests__/__snapshots__/delete-flat-entity-foreign-key-aggregators.util.spec.ts.snap
index 83aadd49036..212bd161949 100644
--- a/packages/twenty-server/src/engine/workspace-manager/workspace-migration/universal-flat-entity/utils/__tests__/__snapshots__/delete-flat-entity-foreign-key-aggregators.util.spec.ts.snap
+++ b/packages/twenty-server/src/engine/workspace-manager/workspace-migration/universal-flat-entity/utils/__tests__/__snapshots__/delete-flat-entity-foreign-key-aggregators.util.spec.ts.snap
@@ -79,6 +79,7 @@ exports[`deleteFlatEntityForeignKeyAggregators should strip raw workspace-scoped
"readability": "OPEN",
"readabilityParentFieldUniversalIdentifiers": null,
"searchFieldMetadataUniversalIdentifiers": [],
+ "sharingReach": "WORKSPACE",
"shortcut": "shortcut",
"targetTableName": "",
"universalIdentifier": "object-universal-identifier",
diff --git a/packages/twenty-server/test/integration/graphql/suites/object-records-permissions/record-level-sharing-restricted-record-surfaces.integration-spec.ts b/packages/twenty-server/test/integration/graphql/suites/object-records-permissions/record-level-sharing-restricted-record-surfaces.integration-spec.ts
index da735807e80..19695172729 100644
--- a/packages/twenty-server/test/integration/graphql/suites/object-records-permissions/record-level-sharing-restricted-record-surfaces.integration-spec.ts
+++ b/packages/twenty-server/test/integration/graphql/suites/object-records-permissions/record-level-sharing-restricted-record-surfaces.integration-spec.ts
@@ -203,7 +203,7 @@ describe('A restricted record on an object open by default', () => {
APPLE_JONY_MEMBER_ACCESS_TOKEN,
);
- expect(response.body.data?.company ?? null).toBeNull();
+ expect(response.body.errors?.[0]?.extensions?.code).toBe('NOT_FOUND');
});
it('should leave it out of group counts', async () => {
@@ -449,5 +449,14 @@ describe('A restricted record on an object open by default', () => {
);
expect(collectIds(notes.body.data.notes.edges)).toEqual([NOTE_ID]);
+
+ await setShare(
+ { workspaceMemberId: WORKSPACE_MEMBER_DATA_SEED_IDS.JONY },
+ false,
+ );
+
+ expect((await findCompanyIds(APPLE_JONY_MEMBER_ACCESS_TOKEN)).ids).toEqual([
+ OPEN_COMPANY_ID,
+ ]);
});
});
diff --git a/packages/twenty-server/test/integration/graphql/suites/object-records-permissions/record-sharing-beyond-role.integration-spec.ts b/packages/twenty-server/test/integration/graphql/suites/object-records-permissions/record-sharing-beyond-role.integration-spec.ts
new file mode 100644
index 00000000000..422de4addb4
--- /dev/null
+++ b/packages/twenty-server/test/integration/graphql/suites/object-records-permissions/record-sharing-beyond-role.integration-spec.ts
@@ -0,0 +1,448 @@
+import { randomUUID } from 'node:crypto';
+
+import { parse } from 'graphql';
+import { EVERYONE_PRINCIPAL_ID } from 'twenty-shared/constants';
+import { type ObjectRecordEvent } from 'twenty-shared/database-events';
+import { isDefined } from 'twenty-shared/utils';
+import {
+ FeatureFlagKey,
+ ObjectSharingReach,
+ RecordShareAccessLevel,
+ RowLevelPermissionPredicateOperand,
+} from 'twenty-shared/types';
+
+import { createOneOperationFactory } from 'test/integration/graphql/utils/create-one-operation-factory.util';
+import { deleteOneOperationFactory } from 'test/integration/graphql/utils/delete-one-operation-factory.util';
+import { destroyManyOperationFactory } from 'test/integration/graphql/utils/destroy-many-operation-factory.util';
+import { findManyOperationFactory } from 'test/integration/graphql/utils/find-many-operation-factory.util';
+import { makeGraphqlApiRequest } from 'test/integration/graphql/utils/make-graphql-api-request.util';
+import { updateOneOperationFactory } from 'test/integration/graphql/utils/update-one-operation-factory.util';
+import { createOneObjectMetadata } from 'test/integration/metadata/suites/object-metadata/utils/create-one-object-metadata.util';
+import { deleteOneObjectMetadata } from 'test/integration/metadata/suites/object-metadata/utils/delete-one-object-metadata.util';
+import { updateOneObjectMetadata } from 'test/integration/metadata/suites/object-metadata/utils/update-one-object-metadata.util';
+import { upsertObjectPermissions } from 'test/integration/metadata/suites/object-permission/utils/upsert-object-permissions.util';
+import { findOneRoleByLabel } from 'test/integration/metadata/suites/role/utils/find-one-role-by-label.util';
+import { upsertRowLevelPermissionPredicates } from 'test/integration/metadata/suites/row-level-permission-predicate/utils/upsert-row-level-permission-predicates.util';
+import { updateFeatureFlag } from 'test/integration/metadata/suites/utils/update-feature-flag.util';
+import { makeMetadataApiRequest } from 'test/integration/metadata/suites/utils/make-metadata-api-request.util';
+import { getAppProviderByClassName } from 'test/integration/utils/get-app-provider-by-class-name.util';
+
+import { type RecordSharePrincipalInput } from 'src/engine/core-modules/record-share/dtos/record-sharing.dto';
+import { type RecordAccessPolicyService } from 'src/engine/core-modules/record-share/services/record-access-policy.service';
+import { findFlatEntityByIdInFlatEntityMaps } from 'src/engine/metadata-modules/flat-entity/utils/find-flat-entity-by-id-in-flat-entity-maps.util';
+import { type WorkspaceCacheService } from 'src/engine/workspace-cache/services/workspace-cache.service';
+import { type RecordShareStorageService } from 'src/engine/core-modules/record-share/services/record-share-storage.service';
+import { SEED_APPLE_WORKSPACE_ID } from 'src/engine/workspace-manager/dev-seeder/core/constants/seeder-workspaces.constant';
+import { WORKSPACE_MEMBER_DATA_SEED_IDS } from 'src/engine/workspace-manager/dev-seeder/data/constants/workspace-member-data-seeds.constant';
+
+const OBJECT_NAME = 'beyondRoleRecord';
+const OBJECT_PLURAL = 'beyondRoleRecords';
+const SHARED_RECORD_ID = randomUUID();
+const OTHER_RECORD_ID = randomUUID();
+const workspaceId = SEED_APPLE_WORKSPACE_ID;
+const JONY = { workspaceMemberId: WORKSPACE_MEMBER_DATA_SEED_IDS.JONY };
+const EVERYONE = { everyone: true };
+const SET_SHARE = parse(
+ `mutation SetShare($target: RecordSharingTargetInput!, $principal: RecordSharePrincipalInput!, $enabled: Boolean!, $accessLevel: RecordShareAccessLevel) { setRecordShare(target: $target, principal: $principal, enabled: $enabled, accessLevel: $accessLevel) { viewerAccessLevel } }`,
+);
+const READ_SHARING = parse(
+ `query RecordSharing($target: RecordSharingTargetInput!) { recordSharing(target: $target) { viewerAccessLevel permissions { canRead canUpdate canDelete } shares { principalId } } }`,
+);
+
+describe('Records shared beyond the role that can access their object', () => {
+ let objectMetadataId: string;
+ let nameFieldMetadataId: string;
+ let memberRoleId: string;
+ let shares: RecordShareStorageService;
+ const target = (recordId = SHARED_RECORD_ID) => ({
+ objectMetadataId,
+ recordId,
+ });
+
+ const setRecordSharingEnabled = (value: boolean) =>
+ updateFeatureFlag({
+ featureFlag: FeatureFlagKey.IS_RECORD_LEVEL_SHARING_ENABLED,
+ value,
+ expectToFail: false,
+ });
+
+ const setShare = ({
+ principal,
+ enabled = true,
+ accessLevel = RecordShareAccessLevel.READ,
+ token = APPLE_JANE_ADMIN_ACCESS_TOKEN,
+ }: {
+ principal: RecordSharePrincipalInput;
+ enabled?: boolean;
+ accessLevel?: RecordShareAccessLevel;
+ token?: string;
+ }) =>
+ makeMetadataApiRequest(
+ {
+ query: SET_SHARE,
+ variables: { target: target(), principal, enabled, accessLevel },
+ },
+ token,
+ );
+
+ const setMemberObjectAccess = (canAccessObject: boolean) =>
+ upsertObjectPermissions({
+ expectToFail: false,
+ input: {
+ roleId: memberRoleId,
+ objectPermissions: [
+ {
+ objectMetadataId,
+ canReadObjectRecords: canAccessObject,
+ canUpdateObjectRecords: canAccessObject,
+ canSoftDeleteObjectRecords: canAccessObject,
+ canDestroyObjectRecords: canAccessObject,
+ },
+ ],
+ },
+ });
+
+ const setSharingReach = (sharingReach: ObjectSharingReach) =>
+ updateOneObjectMetadata({
+ expectToFail: false,
+ input: { idToUpdate: objectMetadataId, updatePayload: { sharingReach } },
+ });
+
+ const findIdsAsJony = async () => {
+ const response = await makeGraphqlApiRequest(
+ findManyOperationFactory({
+ objectMetadataSingularName: OBJECT_NAME,
+ objectMetadataPluralName: OBJECT_PLURAL,
+ gqlFields: 'id name',
+ filter: { id: { in: [SHARED_RECORD_ID, OTHER_RECORD_ID] } },
+ }),
+ APPLE_JONY_MEMBER_ACCESS_TOKEN,
+ );
+
+ return {
+ errors: response.body.errors,
+ ids: (response.body.data?.[OBJECT_PLURAL]?.edges ?? []).map(
+ ({ node }: { node: { id: string } }) => node.id,
+ ),
+ };
+ };
+
+ const renameAsJony = (name: string) =>
+ makeGraphqlApiRequest(
+ updateOneOperationFactory({
+ objectMetadataSingularName: OBJECT_NAME,
+ gqlFields: 'id',
+ recordId: SHARED_RECORD_ID,
+ data: { name },
+ }),
+ APPLE_JONY_MEMBER_ACCESS_TOKEN,
+ );
+
+ beforeAll(async () => {
+ shares = getAppProviderByClassName<RecordShareStorageService>(
+ 'RecordShareStorageService',
+ );
+ memberRoleId = (await findOneRoleByLabel({ label: 'Member' })).id;
+
+ const { data } = await createOneObjectMetadata({
+ input: {
+ nameSingular: OBJECT_NAME,
+ namePlural: OBJECT_PLURAL,
+ labelSingular: 'Beyond role record',
+ labelPlural: 'Beyond role records',
+ icon: 'IconShare',
+ isLabelSyncedWithName: false,
+ },
+ gqlFields: 'id labelIdentifierFieldMetadataId',
+ });
+
+ objectMetadataId = data.createOneObject.id;
+ // Custom objects come with a name field as their label identifier
+ nameFieldMetadataId = data.createOneObject.labelIdentifierFieldMetadataId!;
+
+ for (const [id, name] of [
+ [SHARED_RECORD_ID, 'Shared'],
+ [OTHER_RECORD_ID, 'Visible'],
+ ]) {
+ const created = await makeGraphqlApiRequest(
+ createOneOperationFactory({
+ objectMetadataSingularName: OBJECT_NAME,
+ gqlFields: 'id',
+ data: { id, name },
+ }),
+ );
+
+ expect(created.body.errors).toBeUndefined();
+ }
+
+ await setRecordSharingEnabled(true);
+ });
+
+ beforeEach(async () => {
+ await shares.deleteByRecordIds({
+ workspaceId,
+ objectMetadataId,
+ recordIds: [SHARED_RECORD_ID, OTHER_RECORD_ID],
+ });
+ await setMemberObjectAccess(false);
+ await setSharingReach(ObjectSharingReach.WORKSPACE);
+ });
+
+ afterAll(async () => {
+ await setRecordSharingEnabled(false);
+ await setMemberObjectAccess(true);
+ await shares.deleteByRecordIds({
+ workspaceId,
+ objectMetadataId,
+ recordIds: [SHARED_RECORD_ID, OTHER_RECORD_ID],
+ });
+ await makeGraphqlApiRequest(
+ destroyManyOperationFactory({
+ objectMetadataSingularName: OBJECT_NAME,
+ objectMetadataPluralName: OBJECT_PLURAL,
+ gqlFields: 'id',
+ filter: { id: { in: [SHARED_RECORD_ID, OTHER_RECORD_ID] } },
+ }),
+ );
+ await updateOneObjectMetadata({
+ input: {
+ idToUpdate: objectMetadataId,
+ updatePayload: { isActive: false },
+ },
+ expectToFail: false,
+ });
+ await deleteOneObjectMetadata({ input: { idToDelete: objectMetadataId } });
+ });
+
+ it('should show nothing to a role without access until a record is named for it', async () => {
+ expect(await findIdsAsJony()).toEqual({ errors: undefined, ids: [] });
+ });
+
+ it('should reach only the record named for the member', async () => {
+ expect((await setShare({ principal: JONY })).body.errors).toBeUndefined();
+
+ expect(await findIdsAsJony()).toEqual({
+ errors: undefined,
+ ids: [SHARED_RECORD_ID],
+ });
+ expect((await renameAsJony('Not allowed')).body.errors).toBeDefined();
+ });
+
+ it('should let an edit grant edit, but never delete or manage access', async () => {
+ await setShare({
+ principal: JONY,
+ accessLevel: RecordShareAccessLevel.FULL,
+ });
+
+ expect((await renameAsJony('Edited by Jony')).body.errors).toBeUndefined();
+
+ const deleted = await makeGraphqlApiRequest(
+ deleteOneOperationFactory({
+ objectMetadataSingularName: OBJECT_NAME,
+ gqlFields: 'id',
+ recordId: SHARED_RECORD_ID,
+ }),
+ APPLE_JONY_MEMBER_ACCESS_TOKEN,
+ );
+
+ expect(deleted.body.errors).toBeDefined();
+ expect(
+ (
+ await setShare({
+ principal: EVERYONE,
+ enabled: false,
+ token: APPLE_JONY_MEMBER_ACCESS_TOKEN,
+ })
+ ).body.errors,
+ ).toBeDefined();
+
+ const sharing = await makeMetadataApiRequest(
+ { query: READ_SHARING, variables: { target: target() } },
+ APPLE_JONY_MEMBER_ACCESS_TOKEN,
+ );
+
+ expect(sharing.body.data.recordSharing).toMatchObject({
+ viewerAccessLevel: RecordShareAccessLevel.FULL,
+ permissions: { canRead: true, canUpdate: true, canDelete: false },
+ shares: [],
+ });
+ });
+
+ it('should not let general access reach beyond the role', async () => {
+ const share = await setShare({
+ principal: EVERYONE,
+ accessLevel: RecordShareAccessLevel.READ_WRITE,
+ });
+
+ expect(share.body.errors).toBeUndefined();
+ expect(await findIdsAsJony()).toEqual({ errors: undefined, ids: [] });
+ });
+
+ it('should let a role grant reach every member of the role', async () => {
+ await setShare({ principal: { roleId: memberRoleId } });
+
+ expect((await findIdsAsJony()).ids).toEqual([SHARED_RECORD_ID]);
+ });
+
+ it('should stay within the role when the object limits sharing to it', async () => {
+ await setShare({ principal: JONY });
+ await setSharingReach(ObjectSharingReach.ROLE_ACCESS);
+
+ expect((await findIdsAsJony()).errors).toBeDefined();
+ });
+
+ it('should let a named grant reach a record the row filter of the role hides', async () => {
+ await setMemberObjectAccess(true);
+ await upsertRowLevelPermissionPredicates({
+ expectToFail: false,
+ input: {
+ roleId: memberRoleId,
+ objectMetadataId,
+ predicates: [
+ {
+ fieldMetadataId: nameFieldMetadataId,
+ operand: RowLevelPermissionPredicateOperand.CONTAINS,
+ value: 'Visible',
+ },
+ ],
+ predicateGroups: [],
+ },
+ });
+
+ try {
+ expect((await findIdsAsJony()).ids).toEqual([OTHER_RECORD_ID]);
+
+ await setShare({
+ principal: JONY,
+ accessLevel: RecordShareAccessLevel.READ_WRITE,
+ });
+
+ expect((await findIdsAsJony()).ids.sort()).toEqual(
+ [SHARED_RECORD_ID, OTHER_RECORD_ID].sort(),
+ );
+ expect(
+ (await renameAsJony('Edited under a row filter')).body.errors,
+ ).toBeUndefined();
+
+ await setSharingReach(ObjectSharingReach.ROLE_ACCESS);
+
+ expect((await findIdsAsJony()).ids).toEqual([OTHER_RECORD_ID]);
+ } finally {
+ await upsertRowLevelPermissionPredicates({
+ expectToFail: false,
+ input: {
+ roleId: memberRoleId,
+ objectMetadataId,
+ predicates: [],
+ predicateGroups: [],
+ },
+ });
+ }
+ });
+
+ it('should deliver events of the records named for the member only', async () => {
+ const workspaceCacheService =
+ getAppProviderByClassName<WorkspaceCacheService>('WorkspaceCacheService');
+ const resolveAdmittedRecordIds = async () => {
+ const { flatObjectMetadataMaps, rolesPermissions } =
+ await workspaceCacheService.getOrRecompute(workspaceId, [
+ 'flatObjectMetadataMaps',
+ 'rolesPermissions',
+ ]);
+ const objectMetadata = findFlatEntityByIdInFlatEntityMaps({
+ flatEntityId: objectMetadataId,
+ flatEntityMaps: flatObjectMetadataMaps,
+ });
+
+ if (!isDefined(objectMetadata)) {
+ throw new Error('Test object metadata is missing');
+ }
+
+ return getAppProviderByClassName<RecordAccessPolicyService>(
+ 'RecordAccessPolicyService',
+ )
+ .buildEventRecordAccessGate({
+ name: `${OBJECT_NAME}.updated`,
+ workspaceId,
+ objectMetadata,
+ events: [SHARED_RECORD_ID, OTHER_RECORD_ID].map((recordId) => ({
+ recordId,
+ properties: { after: { id: recordId } },
+ })) as ObjectRecordEvent[],
+ })
+ .resolveAdmittedRecordIds({
+ isSystemContext: false,
+ objectsPermissions: rolesPermissions[memberRoleId],
+ principalIds: [
+ EVERYONE_PRINCIPAL_ID,
+ WORKSPACE_MEMBER_DATA_SEED_IDS.JONY,
+ memberRoleId,
+ ],
+ isOwningApplication: () => false,
+ resolveRowLevelPermissionRecordFilter: () => null,
+ });
+ };
+
+ expect((await findIdsAsJony()).ids).toEqual([]);
+ expect([...(await resolveAdmittedRecordIds())]).toEqual([]);
+
+ await setShare({ principal: JONY });
+
+ expect((await findIdsAsJony()).ids).toEqual([SHARED_RECORD_ID]);
+ expect([...(await resolveAdmittedRecordIds())]).toEqual([SHARED_RECORD_ID]);
+
+ await setSharingReach(ObjectSharingReach.ROLE_ACCESS);
+
+ expect([...(await resolveAdmittedRecordIds())]).toEqual([]);
+ });
+
+ it('should keep grants within the role while the flag is off', async () => {
+ await setShare({ principal: JONY });
+ await setRecordSharingEnabled(false);
+
+ try {
+ expect((await findIdsAsJony()).errors).toBeDefined();
+ } finally {
+ await setRecordSharingEnabled(true);
+ }
+ });
+
+ it('should let admins change the reach of a standard object', async () => {
+ const { data } = await makeMetadataApiRequest({
+ query: parse(
+ `query { objects(paging: { first: 1000 }) { edges { node { id nameSingular sharingReach } } } }`,
+ ),
+ }).then((response) => response.body);
+ const company = data.objects.edges
+ .map(({ node }: { node: { nameSingular: string } }) => node)
+ .find(
+ ({ nameSingular }: { nameSingular: string }) =>
+ nameSingular === 'company',
+ );
+
+ expect(company.sharingReach).toBe(ObjectSharingReach.WORKSPACE);
+
+ try {
+ const { data: updated } = await updateOneObjectMetadata({
+ expectToFail: false,
+ input: {
+ idToUpdate: company.id,
+ updatePayload: { sharingReach: ObjectSharingReach.ROLE_ACCESS },
+ },
+ gqlFields: 'sharingReach',
+ });
+
+ expect(updated.updateOneObject.sharingReach).toBe(
+ ObjectSharingReach.ROLE_ACCESS,
+ );
+ } finally {
+ await updateOneObjectMetadata({
+ expectToFail: false,
+ input: {
+ idToUpdate: company.id,
+ updatePayload: { sharingReach: ObjectSharingReach.WORKSPACE },
+ },
+ });
+ }
+ });
+});
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-export-application-data-model.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-export-application-data-model.integration-spec.ts.snap
index a9540301721..d7f8218f023 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-export-application-data-model.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-export-application-data-model.integration-spec.ts.snap
@@ -952,6 +952,7 @@ exports[`Application export - data model exports the whole application as a stab
"openRecordIn": "USER_CHOICE",
"readability": "OPEN",
"readabilityParentFieldUniversalIdentifiers": null,
+ "sharingReach": "WORKSPACE",
"universalIdentifier": "<TICKET_OBJECT>",
"writability": "OPEN",
},
@@ -994,6 +995,7 @@ exports[`Application export - data model exports the whole application as a stab
"openRecordIn": "USER_CHOICE",
"readability": "OPEN",
"readabilityParentFieldUniversalIdentifiers": null,
+ "sharingReach": "WORKSPACE",
"universalIdentifier": "<PROJECT_OBJECT>",
"writability": "OPEN",
},
diff --git a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap
index fc1a0d03d48..d03e935dad2 100644
--- a/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap
+++ b/packages/twenty-server/test/integration/metadata/suites/application/__snapshots__/successful-sync-application-workspace-migration.integration-spec.ts.snap
@@ -172,6 +172,7 @@ exports[`syncApplication should delete old field and create equivalent one when
"overrides": null,
"readability": "OPEN",
"readabilityParentFieldUniversalIdentifiers": null,
+ "sharingReach": "WORKSPACE",
"shortcut": null,
"targetTableName": "DEPRECATED",
"universalIdentifier": Any<String>,
@@ -1915,6 +1916,7 @@ exports[`syncApplication should return workspace migration actions on initial sy
"overrides": null,
"readability": "OPEN",
"readabilityParentFieldUniversalIdentifiers": null,
+ "sharingReach": "WORKSPACE",
"shortcut": null,
"targetTableName": "DEPRECATED",
"universalIdentifier": Any<String>,
diff --git a/packages/twenty-shared/src/application/objectManifestType.ts b/packages/twenty-shared/src/application/objectManifestType.ts
index aff6160f848..6feb2ed7272 100644
--- a/packages/twenty-shared/src/application/objectManifestType.ts
+++ b/packages/twenty-shared/src/application/objectManifestType.ts
@@ -3,6 +3,7 @@ import { type SyncableEntityOptions } from '@/application/syncableEntityOptionsT
import { type MetadataReadability } from '@/types/MetadataReadability';
import { type MetadataWritability } from '@/types/MetadataWritability';
import { type ObjectOpenRecordIn } from '@/types/ObjectOpenRecordIn';
+import { type ObjectSharingReach } from '@/types/ObjectSharingReach';
export type ObjectManifest = SyncableEntityOptions & {
nameSingular: string;
@@ -19,6 +20,7 @@ export type ObjectManifest = SyncableEntityOptions & {
writability?: MetadataWritability;
readability?: MetadataReadability;
readabilityParentFieldUniversalIdentifiers?: string[] | null;
+ sharingReach?: ObjectSharingReach;
openRecordIn?: ObjectOpenRecordIn;
fields: ObjectFieldManifest[];
labelIdentifierFieldMetadataUniversalIdentifier: string;
diff --git a/packages/twenty-shared/src/types/ObjectSharingReach.ts b/packages/twenty-shared/src/types/ObjectSharingReach.ts
new file mode 100644
index 00000000000..b10731a9a13
--- /dev/null
+++ b/packages/twenty-shared/src/types/ObjectSharingReach.ts
@@ -0,0 +1,4 @@
+export enum ObjectSharingReach {
+ ROLE_ACCESS = 'ROLE_ACCESS',
+ WORKSPACE = 'WORKSPACE',
+}
diff --git a/packages/twenty-shared/src/types/index.ts b/packages/twenty-shared/src/types/index.ts
index bdd4e88def9..1e3dafe43cc 100644
--- a/packages/twenty-shared/src/types/index.ts
+++ b/packages/twenty-shared/src/types/index.ts
@@ -195,6 +195,7 @@ export type {
} from './ObjectRecordGroupBy';
export { OrderByDirection } from './ObjectRecordGroupBy';
export { ObjectRecordGroupByDateGranularity } from './ObjectRecordGroupByDateGranularity';
+export { ObjectSharingReach } from './ObjectSharingReach';
export type { ObjectsPermissions } from './ObjectsPermissions';
export type { ObjectsPermissionsByRoleId } from './ObjectsPermissionsByRoleId';
export { OpenRecordIn } from './OpenRecordIn';