---
id: TST-PFM-SEC-182
title: Get security context 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/security-context/get-security-context.integration.spec.js
implements:
  - ATS-PFM-SEC-007-02
  - ATS-PFM-SEC-007-03
  - ATS-PFM-SEC-007-04
  - ATS-PFM-SEC-007-05
  - ATS-PFM-SEC-007-13
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/security-context/get-security-context.integration.spec.js#security
      capability: getSecurityContext
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#a
      customer-scope Read Only grant: the whole document
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#answers
      the caller, their organization, both of its tenants, the applications and every read key, and
      nothing else
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#answers
      the same document for the tenant the caller names by path, evaluated there
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#evaluates
      the tenant the caller prefers, when the caller reaches it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#ignores
      a preferred tenant of another customer and falls back to the caller's default
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#refuses
      another customer's tenant named by path, which the caller's grants do not reach
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#refuses
      a tenant that does not exist with the same sentence, so the route never says which ids are
      real
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#a
      tenant-scoped grant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#lists
      only the tenant the grant names, and evaluates it, though the customer has two
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#allows
      the Standard User keys there, and reports the grant as the tenant-scoped grant it is
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#reaches
      nothing in the other tenant of the same customer, where the grant does not reach
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#ignores
      a preferred tenant the grant does not reach and evaluates the one it does
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#a
      tenant that is not yet usable
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#offers
      the customer’s own person only the tenants they can work in
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#never
      starts the session in it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#refuses
      the customer’s own person the tenant they name by path while it is being provisioned
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#refuses
      Rhythm staff it by path, because staff enter another customer’s tenant only through a grant
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#a
      deny beside an allow
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#takes
      the denied key out of the allowed keys, though another grant allows it
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#reports
      the deny pattern that produced it, before the allows it beat
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#Rhythm
      staff's `allow *`
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#expands
      the wildcard to every concrete key of the catalog in Rhythm HQ, the staff-only one included
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#allows
      the same person nothing on a console route, because a platform-scope grant counts on `system`
      alone
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#marks
      the holder of a platform-scope grant as staff, and reports no console rule the grant did not
      give them
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#lists
      no tenant for Rhythm's own customer, which has none, and evaluates none
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#a
      grant that is no longer in force
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#allows
      nothing, reaches no tenant and reports no grant at all
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#answers
      `null` for the display name the user was never given, rather than leaving the key out
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#the
      sign-in stamp the boot call writes
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#had
      nothing on the row before the first read (premise)
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#records
      the instant the document was built, and leaves the status and the version where they were
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#does
      not write again on a second read in the same minute
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#writes
      again once a minute has passed, so the column still says when the person was last here
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#a
      caller with no grants at all
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#is
      refused their own document rather than answered an empty one
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#names
      the refusal with the code the console reads as no access
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#records
      no sign-in, because the boot call never became a document
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#is
      answered the whole document as soon as somebody grants them a role
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#a
      caller whose only grant is still pending acceptance
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#holds
      a pending assignment and nothing else (premise)
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#is
      refused, because a grant nobody has accepted is a grant nobody holds
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#a
      caller whose only grant opens tomorrow
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#holds
      an active assignment whose window has not opened, and nothing else (premise)
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#is
      refused under the code the console reads as no access
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#is
      answered the document once the window has opened
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#a
      caller whose only grant is a customer's own custom role
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#allows
      the one key the custom role names, and no key of any built-in
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#names
      the caller, their organization and the tenants the grant reaches
  - provenance: test
    source: >-
      services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js#reports
      the custom role behind it, by the name the customer gave it
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/services/security-context/get-security-context.integration.spec.js
  - >-
    Static review at the recorded source revision; executable results remain not-run and conformance
    remains not-verified.
binding_note: >-
  Each binding names the scenario to which this file contributes assertions. A binding is not a
  recorded pass and does not extend the file’s dependency boundary.
examiner: codex
examined_at: '2026-10-23'
final_text: OpenAI
dependency_review:
  provenance: test
  source: >-
    services-platform:modules/security/tests/integration/services/security-context/get-security-context.integration.spec.js
  explicit_no_doubles: true
  identified_double_boundaries: []
---
# Get security context 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 get security context.

## What This Suite Proves

The source assertions support the observations named in the bound scenarios. A scenario spanning multiple files must retain the other files’ contributions.

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