Test timeline activity access for every permission mechanism

Merged
CH
5d ago
+915-258

Follow-up to #31708, which is merged; this PR only adds tests.

Integration coverage for the per-record timeline activity check, in the permission test pattern. test/integration/permissions/record-access/timeline-activity-access.integration-spec.ts runs on describePermissionTestWorkspace, with its fixture in create-permission-test-timeline-fixture.util.ts. Each case reads timeline activities with an API key on a role and checks which of a record's values come back.

CaseExpected
Role reads all recordsevery value
Object deniedno value
Row-level rule hides the recordvalues of the kept record only
Field restrictedthe restricted field is stripped
Filter on properties with a restricted fieldrefused
Timeline relation restrictedevery value
Record shared outside the row-level ruleevery value
Access group (visibility tier) hides the recordvalues of the reached record only
Private record not givenno value
Record reached through a related-record pathvalues of the reached record only
Event stream, row-level rule hides the recordvalues of the kept record only

Run against the code before #31708, six of the ten mechanism cases fail.

Also in this PR

  • timeline-activity-field-permissions.integration-spec.ts under graphql/suites/timeline is removed; its cases are covered by the new suite.
  • setRecordShareOperationFactory takes a principal (member or role) so a record can be shared with a role.
  • createRelatedRecordPath takes an accessToken so it works in the permission test workspace.
  • findFieldMetadataIdByName and findManyFieldsMetadata take an optional token, so they work outside the seed workspace.