---
id: TST-PFM-SEC-193
title: Staff member access grants database and service checks
kind: integration
product_area: platform
module: security
revision: 2
status: draft
source_sha:
  services-platform: ad3f6a6582843008ed0f5a17b131878d15829af1
repository: services-platform
files:
  - >-
    modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js
implements: []
environment: local
implementation_state: implemented
latest_result: not-run
latest_run_at: null
latest_run_ref: null
conformance: not-verified
estimated_minutes: 3
isolation: Use the prepared test database and suite-owned fixture rows; retain shared seed records.
assertion_evidence:
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#staff
      access capability: one staff member’s grants from Rhythm HQ
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#the
      member’s list
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#answers
      the member’s active grant and the one that ended inside the window, newest first
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#names
      who ended the grant somebody ended, and nobody for one still running
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#leaves
      out a grant that ended before the ninety days the screen reads
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#answers
      the grant with the names of what it reaches and why it was opened
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#refuses
      a user who is not Rhythm staff as 404, exactly as an unknown id
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#a
      member holding more grants than the list answers
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#answers
      the hundred newest and no more
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#leaves
      out the oldest of them, and none of the rest
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#ending
      a member’s emergency grant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#stores
      the grant revoked, against the administrator who ended it, for the reason they gave
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#answers
      the grant as stored
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#revokes
      the assignment the grant materialized, so the access is gone at once
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#writes
      one endStaffAccess audit event, on the grant’s customer and tenant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#submits
      one authorizer flush naming the grant, so a signed context stops carrying the assignment
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#refuses
      ending it a second time, 409 staff_access_grant_ended, leaving the row as it was
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#refuses
      a reason the standing-access ensure reads as the system’s own, 400, leaving the grant active
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#refuses
      a reason longer than a grant may record, 400, leaving the grant active
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#records
      its own reason when the body gives none
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#ending
      a member’s approved grant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#ends
      it as any other grant: revoked against the administrator, its assignment revoked, one
      endStaffAccess event
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#a
      grant that is not that member’s
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#answers
      404, reporting nothing about whose the grant is
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#leaves
      the grant active, and its assignment with it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#ends
      the same grant for the member who does hold it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#a
      staff member who may read the list but not end a grant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#reads
      the member’s grants, which every HQ role may
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#is
      refused the end, and the grant stays active with its assignment
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#writes
      no audit event for the refused attempt, the route-level refusal being the record
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#refusing
      to end a founding staff member’s standing grant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#refuses
      it 409 staff_access_grant_standing, naming the grant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#leaves
      the standing grant active and unchanged, its assignment with it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#records
      no end on the trail, only the grant the ensure wrote
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#submits
      no authorizer flush for the refused end
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#refusing
      to end a Rhythm Administrator’s customer-level standing grant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#lists
      the grant on the wire with its customer named and both tenant fields null
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#refuses
      it 409 staff_access_grant_standing, naming the grant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#leaves
      the grant active and unchanged, its customer-scoped assignment with it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js#writes
      no audit event and submits no authorizer flush for the refused end
dependency_evidence: >-
  The prepared PostgreSQL database supplies the persisted fixtures and constraints exercised here.
  The suite controls the clock at the declared seams; those collaborators remain outside its live
  proof.
evidence:
  - >-
    services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js
  - >-
    Static review at the recorded source revision; executable results remain not-run and conformance
    remains not-verified.
binding_note: >-
  The file has no scenario binding established by this examination. Its executable checks remain
  registered without assigning them broader acceptance coverage.
examiner: codex
examined_at: '2026-10-23'
final_text: OpenAI
dependency_review:
  provenance: test
  source: >-
    services-platform:modules/security/tests/integration/services/staff-access/staff-member-access-grants.integration.spec.js
  explicit_no_doubles: false
  identified_double_boundaries:
    - the clock
---
# Staff member access grants database and service checks

## Verification Boundary

The file exercises database or service behavior through the local integration harness. The assertion references identify the source checks for staff member access grants.

## What This Suite Proves

The file supplies executable engineering checks for the named subject. No complete acceptance scenario is inferred from the file’s existence.

## What It Does Not Prove

This examination does not run the suite. Passing behavior, deployed conformance and the behavior of substituted dependencies require separate execution evidence.

## Real Dependencies and Test Doubles

The prepared PostgreSQL database supplies the persisted fixtures and constraints exercised here. The suite controls the clock at the declared seams; those collaborators remain outside its live proof.

## Must Not Be Doubled

Keep the queried database, applicable constraints and transaction boundaries real. Provider substitutes cannot establish delivery, cloud execution or cross-service recovery.
