---
id: TST-PFM-SEC-073
title: Role holders 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/db/role-holders.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/db/role-holders.integration.spec.js#platform.role_holders
      (who holds a security role in a tenant, for other services)
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#the
      holders of a role in the tenant, no resource named
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      the tenant-wide, customer-wide and empty-conditions holders, each with its contact, name and
      address
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#leaves
      out the holder on one resource, who does not hold the role in the tenant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#leaves
      out a pending assignment
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#leaves
      out a revoked assignment
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#leaves
      out an assignment whose validity ended
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#leaves
      out an assignment whose validity has not begun
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#leaves
      out a conditional assignment, which is not a plain holding
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#leaves
      out a suspended user
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#leaves
      out a member of Rhythm’s staff reaching the tenant through a tenant access grant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#leaves
      out the holder in another tenant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      that other tenant’s holder, and the customer-wide one, to a caller in that tenant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      no holder of an archived role
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      no holder of a role nobody holds
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#the
      holders of a role on one resource
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      the holder on that resource with its linked contact and address, plus every tenant-wide holder
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      only the tenant-wide holders on another resource
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      a holder of the role on the resource and tenant-wide once
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#refuses
      a resource type without its id
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#each
      holder’s e-mail address
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      the address in the canonical lowercase form the users column holds
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#refuses
      the typed form at the users column, so no other form can reach the answer
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      NULL for a holder without an address, and still answers the holder
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      no address of a holder it leaves out
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      exactly its four columns, and no other column of the user
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#the
      tenant boundary
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#refuses
      a caller in one tenant the holders of another
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#refuses
      a caller in no tenant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      a member of Platform’s system role, in no tenant, the tenant it names
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#reads
      the console holders the users policy hides from the same caller
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#leaves
      the caller’s own customer setting as it was once the call returns
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#who
      may call it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      the application role of a sibling service in its tenant transaction
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      Platform’s own application role through withTransaction
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#answers
      a member of the shared table reader, once the migration’s grant has run where the role exists
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#refuses
      a role it was never granted to (42501)
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#its
      declaration
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#is a
      STABLE set-returning definer with search_path pinned
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#grants
      EXECUTE to no one through PUBLIC
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/db/role-holders.integration.spec.js#still
      answers a console holder when its owner is a role the forced users policy binds, as a deployed
      owner is
dependency_evidence: >-
  The prepared PostgreSQL database supplies the persisted fixtures and constraints exercised here.
  The file declares no substituted collaborators.
evidence:
  - 'services-platform:modules/security/tests/integration/db/role-holders.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/db/role-holders.integration.spec.js'
  explicit_no_doubles: true
  identified_double_boundaries: []
---
# Role holders 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 role holders.

## 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 file declares no substituted collaborators.

## 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.
