Test timeline activity access for every permission mechanism
Merged
CH
5d ago+915+915+012345678901234567890123456789-258-258-012345678901234567890123456789
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.
| Case | Expected |
|---|---|
| Role reads all records | every value |
| Object denied | no value |
| Row-level rule hides the record | values of the kept record only |
| Field restricted | the restricted field is stripped |
Filter on properties with a restricted field | refused |
| Timeline relation restricted | every value |
| Record shared outside the row-level rule | every value |
| Access group (visibility tier) hides the record | values of the reached record only |
| Private record not given | no value |
| Record reached through a related-record path | values of the reached record only |
| Event stream, row-level rule hides the record | values 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.tsundergraphql/suites/timelineis removed; its cases are covered by the new suite.setRecordShareOperationFactorytakes aprincipal(member or role) so a record can be shared with a role.createRelatedRecordPathtakes anaccessTokenso it works in the permission test workspace.findFieldMetadataIdByNameandfindManyFieldsMetadatatake an optionaltoken, so they work outside the seed workspace.