To test field-level API permissions, define the fields each consumer may read or change, then compare that contract with actual behavior through every relevant delivery route. Include positive cases, excluded fields, nested properties, record boundaries and permission changes. A successful login, a valid schema or a hidden UI column does not establish that the API enforces the intended scope.
Run the checks only against a system and test identities you are authorized to assess. Use synthetic fixtures in an isolated test environment where practical. The matrix and responses below are proposed examples, not observed Elementrix behavior or a completed security test. Endpoints, credentials and protocol-specific commands are deliberately omitted.
Start with the API data minimization guide to decide what a response should contain. This article owns the next step: how to check that the intended boundary holds. The field-level security guide explains the control types and limitations.

Build a consumer-to-field permission matrix
Name the consumer identity, operation, record scope, product/schema version and effective grant revision before listing fields. An app acting for a person may also need a delegated-user fixture. Keep read and write expectations separate: the right to read a property does not establish the right to update it.
| Field path | partner-router | support-contact | Reason in this example |
|---|---|---|---|
| customer_id | Allowed | Allowed | Identify the authorized customer record. |
| account_status | Allowed | Allowed | Support the defined service task. |
| service_region | Allowed | Excluded | Route assigned work; not needed by the contact task. |
| contact.email | Excluded | Allowed | Contact workflow only. Treat the full nested path as the property under test. |
| credit_limit | Excluded | Excluded | Outside both approved purposes. |
Give partner-router a north-region assigned-record scope and support-contact a case-assigned record scope. Record those predicates as fixtures rather than assuming field controls also filter records. A denied cross-record request and an excluded-property response are different assertions.
Document the expected denial contract. A requested excluded property might be omitted or cause a request-level error, depending on the interface. Pick the intended behavior before running the case. For an omission contract, require the property to be absent; a null, masked or empty value is not absence. For a documented masking contract, test the masking rule explicitly instead.
Positive tests for approved fields
Use one known authorized record with distinct synthetic values. Call the normal consumption route as the intended identity. Assert the expected property paths and their meanings as well as the status outcome. Include an allowed read of the record and a request for a subset of its allowed fields if the interface supports selection.
The router’s proposed response below contains its three approved fields. It is illustrative JSON, not an endpoint contract or evidence of a passed test. Your fixture should specify required and optional properties, permissible error metadata and whether additional properties are forbidden. Avoid an “exact keys” assertion that rejects legitimate documented metadata or permits unreviewed business fields.
{
"customer_id": "SYN-C1042",
"account_status": "active",
"service_region": "north"
}
Repeat the allowed case using a second identity with different field scope. A support response that includes contact.email does not establish that the router can receive it. Keep credentials separate so that a shared broad test account cannot make both cases appear successful.
Negative tests for excluded and nested fields
OWASP’s property-level authorization guidance distinguishes access to an object from access to its individual properties. Translate that distinction into concrete assertions for the routes your application actually exposes. A well-formed response can still contain an unauthorized property.
| Case | Identity and request variation | Expected behavior | Actual / evidence |
|---|---|---|---|
| P01 allowed read | Router reads an assigned north record. | Approved id, status and region appear; documented metadata follows the contract. | Not run — record response assertions and runtime request ID. |
| P02 second scope | Support reads its case-assigned record. | Approved id, status and contact.email; region and credit_limit follow the excluded-field contract. | Not run. |
| N01 excluded read | Router requests credit_limit using an interface-supported selection method. | Documented omission or request denial; no restricted value in body, headers or diagnostics. | Not run. |
| N02 nested property | Router requests contact or contact.email. | Excluded email is not leaked through a parent object, list element or alternate representation. | Not run. |
| N03 record boundary | Router requests a record outside its assigned scope. | Documented denial or concealed not-found behavior; no customer data returned. | Not run. |
| N04 unauthorized change | Where writes exist, attempt to change an excluded property using a test fixture. | Write is rejected or excluded property is ignored only if that is the explicit contract; stored value remains unchanged. | Not run — verify the persisted result through an authorized observer. |
| C01 scope change | Remove an allowed field grant using the authorized test workflow. | After the documented activation bound, new reads honor the narrower scope across relevant paths. | Not run — record change, effective time and request IDs. |
| C02 schema addition | Add a new restricted fixture field through the test schema workflow. | The new property does not become visible merely because it exists in the schema. | Not run. |
| R01 alternate routes | Repeat selected cases via supported list, batch, search, export and cached paths. | Each path preserves its documented authorization boundary. | Not run — list which routes were actually tested. |
Use sentinels to make a leak easy to detect, such as an unmistakably synthetic email and credit-limit value in the fixture. Check structural property paths, not just raw substring matches. A forbidden value could be transformed or escaped; an identical word could also appear harmlessly in documentation or an error label.
Test stale grants, schema changes and exports
Grant changes and warm caches
First warm the relevant test cache using a permitted request. Narrow the grant through the authorized administrative path, record the decision and effective-time expectation, then repeat the read using the intended application. Check the result after the documented propagation window and at relevant boundaries, not against an invented instant-revocation guarantee.
Repeat with sessions or tokens whose lifetimes differ, if those are part of the implementation. Identify whether the request resolves current permissions or relies on a cached decision. A credential refresh and a grant change are different events. Keep the actual timing and rule revision in the evidence. Stopping future retrieval cannot recall copies already delivered.
New properties and schema versions
Use the fixture to check a newly added field, a nested-field move and a renamed property. A grant based on an explicit allowed set should not silently expand through a serializer or an “all columns” query. Test the intended behavior for old and new schema versions and for optional fields that are absent in some records.
Exports and alternate representations
Inventory the routes the consumer can actually use: detail reads, lists, batch responses, search results, downloadable exports and relevant error paths. A restricted property removed from the detail response may still appear in a CSV export or a shared cached object. Where a route does not exist, record “not applicable” with the reason rather than claiming coverage.
For writes, use an authorized observer or a supported read-back path to verify persisted state. Do not conclude that a forbidden update failed merely because the restricted property is absent from the response. Cleanup and reset the synthetic fixture through the normal authorized workflow so one case does not change the next case’s assumptions.
Record actual responses and triage failures
For each execution, keep the case ID, test time, identity reference, environment/build, product/schema version, grant/policy revision where available, fixture version, expected outcome, actual outcome and correlation identifier. Store sanitized evidence with appropriate access controls. Do not paste production credentials or broad response payloads into an unrestricted ticket.
case_id: N02
fixture: customer-status-v1 / synthetic north record
identity: partner-router test identity
operation: read nested contact representation
expected: contact.email absent, or documented request denial
actual: NOT RUN
request_id: TO BE RECORDED
policy_or_grant_revision: TO BE RECORDED
evidence_reference: TO BE RECORDED
The OWASP authorization guidance recommends validating permissions consistently and maintaining authorization tests. A practical regression suite combines permitted and denied cases and reruns the relevant cases after a permission, schema, serializer or delivery-route change.
| Observed issue | Check first | Then verify |
|---|---|---|
| Allowed field missing | Correct identity, fixture, optionality and product version. | Grant activation and projection; distinguish data absence from denial. |
| Excluded property returned | Effective caller context and field grant. | Serialization, nested mapping and alternate-route enforcement. |
| Different result on cache hit | Cache key and authorization/projection placement. | Scope partitioning and grant-change invalidation behavior. |
| Forbidden write persisted | Write-specific authorization and input binding. | Stored-state verification and any bulk or alternate update path. |
| Failure cannot be reproduced | Fixture reset, concurrent changes and time boundaries. | Captured request IDs, environment, policy revision and exact route. |
Use the denied API access decision tree when an allowed case fails before returning data. Keep the data access control guide nearby to distinguish field omission, masking, record filtering and operation authorization. None of those checks substitutes for the others.
Use your field matrix in a technical demo
Bring two consumer identities, one synthetic record and the allowed/excluded field matrix. Ask to walk through the actual delivery path, the proposed denial behavior and the evidence retained for a scope change. Request an Elementrix demo using your field-permission matrix.