Choose which optional cookies you allow. Essential cookies are always on. Your choice lasts for six months and applies to the Testgrity website and workspace.

Essential

Sign-in, security, and remembering your cookie choices.

Always on

Cookie and privacy policy. You can change or withdraw consent at any time using the Cookie button.

Access regression testing

Back to the guide index

Use Check access to verify a D365 user's permissions as part of a normal test case. Testgrity compares the access you expect with the access Dataverse reports for the selected Run as persona. You can check table-level permissions or effective rights on a particular record.

These checks belong to D365 / Model-driven app cases. For website permissions, use the separate Power Pages validation and access actions and Power Pages permission tests.

Before you start

  • Select the correct project and Dataverse connection.
  • Add and authenticate the intended user under Manage connections → Manage personas → D365 users. See Add execution personas.
  • Select that named persona using Run as in the test case's Details row. Default connection identity is unavailable for a case containing Check access.
  • Retrieve metadata to select entities by display name. If metadata is unavailable, enter the entity's logical name, such as account.
  • For record checks, prepare a known test record or open or create it in earlier steps. The record's ownership, business unit, team membership, and sharing must match the scenario you want to test.

Choose what to check

CheckUse it to verifyExpected access
Entity permissionsThe persona's highest effective privilege level for an entity, including direct and team roles.No access, User / team level, Business unit, Business unit and child units, or Entire organization.
Record accessThe persona's effective rights on one specific record, including any applicable sharing.Allowed or Denied for each action.

Entity permissions supports Create, Read, Update, Delete, Assign, Share, Append, and Append to. Record access supports the same actions except Create, because it checks an existing record.

A matching entity permission does not establish access to every individual record. Use Record access when the record's ownership or sharing matters.

Add an entity-permission check

  1. In Designer, select New → New case → D365 / Model-driven app, or open an existing D365 case.
  2. Expand Details to name the case and choose its suite. In the Details row, open Run as and select the required D365 persona.
  3. In the Action Library, expand Validation & assertions and select + beside Check access. Drag the action between existing steps if its position matters.
  4. Confirm Checking as shows the intended persona.
  5. Set Check to Entity permissions and choose the Entity. Metadata selectors show the display name with the logical name underneath.
  6. Choose an Action and Expected access. Select Add access rule for each additional action you want to check. Each action can appear only once in a step.
  7. Select Save. Use the editor's Saved or Unsaved changes status to confirm whether your changes have been saved.

Entity permissions compares the exact expected level, rather than a minimum level:

Expected accessMeaning
No accessNo effective privilege for this action.
User / team levelDataverse Basic privilege depth. Access to particular records may also depend on ownership, teams, sharing, or hierarchy access.
Business unitDataverse Local privilege depth.
Business unit and child unitsDataverse Deep privilege depth.
Entire organizationDataverse Global privilege depth.

For example, Entire organization observed when User / team level was expected is an access mismatch. Broader access can be just as important to detect as missing access.

Expand How access levels are checked in the step for a short explanation. Testgrity compares the highest effective level reported across business units and retains the underlying verification evidence. An unsupported privilege depth produces an execution error.

Add a record-access check

  1. Add Check access to a D365 case with a named Run as persona.
  2. Set Check to Record access and select the Entity.
  3. Under Test record, choose one of the following:
    • Current record from earlier steps — use the record opened by an earlier step.
    • A named reference from an earlier Create Dataverse record step for the same entity.
    • Existing test record — enter its GUID in Record ID.
  4. Set each Action to the required Allowed or Denied expectation. Add or remove rules as needed; at least one rule must remain.
  5. Select Save.

After changing the check type or entity, review the record and every rule again. Switching between Entity permissions and Record access resets rule expectations; switching to Record access removes Create rules.

Denied is an expected access result. Keep the step's expected outcome as Success; do not mark the step as an expected failure. Missing records, authentication problems, and other execution errors cannot pass as proof of denied access.

Record checks inspect effective rights. Update, Delete, Assign, Share, Append, and Append to checks do not perform those operations. An allowed Read also verifies that the record's primary key can be retrieved. A denied Read means the effective Read right is absent; it is not an attempted read-operation denial.

Example checks

Check a salesperson's account permissions

Create a D365 case named Salesperson account permissions, select the Salesperson persona in Run as, and add Open environment followed by Check access. Set the check to Entity permissions → Account and configure these rules within that step:

ActionExpected access
ReadEntire organization
UpdateUser / team level

Set expectations to your organisation's approved policy; these example values do not describe every salesperson role.

Verify that a user cannot delete a shared record

Prepare an Account record with the ownership and sharing required by your scenario. In a D365 case running as the intended persona, add a Record access check using Existing test record and its GUID. Add Read → Allowed and Delete → Denied rules.

A passing result confirms those effective rights on that record. To test another persona, create a separate case and select that persona in Run as. Every access step within one case uses the same selected persona.

Run the suite

  1. Select Run in the header and choose the suite.
  2. Confirm the connection and the saved sessions required by its cases.
  3. Choose Background, Local during local development, or Docker when available.
  4. Select Run suite.

D365 access checks require unattended suite execution. Browser cannot enforce a selected D365 persona and is unavailable for these cases. The worker verifies that the authenticated Dataverse user matches the selected persona before checking access.

You can place access checks before or after normal business-process steps in the same case. Saved suite schedules and CI/CD triggers can also execute these checks in Background mode. See Running tests and reviewing reports.

Review results and evidence

Expand Test case reports in run history to see the case's status and readable failure summary. Select Report for the full report, then expand its Check access step.

ResultMeaningNext step
Policy matchedAll checked actions match their expected access. Individual rules show Matched.Review the recorded persona and expectations before treating the scenario as covered.
Access mismatchAt least one action grants more or less access than expected. Individual rules show Mismatch.Compare Expected and observed access, then review the user's roles and the record's ownership or sharing.
Execution errorAccess could not be established. Affected rules show Could not verify.Check the readable error, persona session, entity, and record. Use report diagnostics when needed.

Each rule shows its action, expected access, observed access, and explanation. Expand Verification details for the verified Dataverse user, record reference, returned rights, privilege references, and business units when available. Execution errors and access mismatches fail the case; a failed query is never treated as successful denial.

The execution summary records Run as using the persona name and username saved with the result. Printable suite summaries show that identity for each case. Editing or deleting a persona does not rewrite historical results. Older results without a named identity show Default; this does not establish which user ran an older result without identity metadata.

Cases containing access checks suppress screenshots, video, and traces for the whole case. Structured access evidence remains available in the report and JSON export. CSV exports retain the execution identity. Saved result snapshots remain available after the ordinary case is edited or deleted, subject to run-log retention.

Maintain existing access cases

Previously saved access cases remain in Designer → Suites & Cases with an Access badge. They open their existing record-right editor. Use normal D365 cases with Check access for new tests.

  1. Select the saved access case. Its suite and connection remain fixed.
  2. Update Case name and Persona as needed.
  3. For each entity and scenario, provide an existing record GUID. Set each right to Allow, Deny, or Not tested.
  4. Select Save access case. Each configured right becomes a generated suite check; Not tested omits that right.
  5. Execute its suite from Run and open the reports for the individual checks.

This editor checks record rights only. Create checks belong to Entity permissions in the normal designer. Scenario labels do not create fixtures or verify a record's ownership or sharing. Keep the supplied test records available between runs.

Edit or remove generated checks through their access case. Delete removes the case and its generated checks while preserving retained historical reports. Cases with every right set to Not tested can remain as drafts. Previously saved multi-persona scenarios appear as separate cases for each configured persona.

Saving creates a new policy revision for future runs. Queued and historical results retain their original snapshots. Reports compare matching checks against up to 500 recent results; changing the persona, record, operation, expectation, or policy revision starts a different comparison group. Concurrent edits are rejected with a reload message instead of silently overwriting another author's changes.

Optional result explanations

Where configured by a workspace administrator, existing access-case reports offer Explain result. Select it for an advisory explanation of the recorded evidence. The control is disabled when the workspace or deployment is not configured.

Explanations use a bounded structured summary that excludes record IDs, usernames, business field values, credentials, screenshots, traces, and raw errors. They cannot change the result or the user's permissions. Requests have a 45-second timeout and a workspace limit of 30 per hour, including failed attempts.

Troubleshooting

  • The case asks for a persona: select a named D365 persona in Run as. Default connection identity cannot be used for Check access.
  • The persona is disconnected or the wrong user is reported: reconnect that persona under Manage connections → Manage personas → D365 users and authenticate the intended user.
  • An entity is missing: refresh the selected connection's metadata, or enter its logical name if metadata is unavailable.
  • The record cannot be resolved: open the intended record earlier in the case, use a matching saved record reference, or supply a valid GUID for the selected entity.
  • An expected denial returns an execution error: fix the authentication, record, metadata, or Dataverse response problem first. Errors cannot demonstrate denied access.
  • No screenshots or video appear: access cases deliberately retain structured evidence instead of those artifacts.

Next steps