---
title: "Verify a role downgrade blocks saving an already open form"
description: "Open an editable record as an editor, downgrade that account through test fixtures, and verify its stale form can no longer commit changes."
canonical_url: "https://vostride.com/agent-library/authorization/role-downgrade-open-form.md"
md_url: "https://vostride.com/agent-library/authorization/role-downgrade-open-form.md"
content_kind: "recipe"
topic: "authorization"
---

# Verify a role downgrade blocks saving an already open form

Open an editable record as an editor, downgrade that account through test fixtures, and verify its stale form can no longer commit changes.

## Risk

Authorization can change while a browser remains open. The application must enforce the current role when saving, even if the editor loaded with valid permissions and still displays controls from its earlier role.

## Fixtures

- A disposable editor account and a record whose initial title and revision are known.
- A supported fixture hook that changes only this account role to viewer while preserving its session.
- A read-only permission and record inspection hook plus the product documented role-propagation deadline.

## Steps

1. Open the record edit form as the editor and verify the account currently has edit permissions.
2. Change the title locally without saving, then run the fixture hook to downgrade the account to viewer.
3. Confirm the role change through the permission hook and allow only the documented propagation boundary before submitting the open form.
4. Press Save once and verify a permission error or read-only transition without a successful saved state.
5. Reload the record and inspect its persisted title and revision; verify the attempted local title was not committed and the viewer can still read the permitted record.

## Expected results

- The save operation uses the downgraded role rather than the role cached when the form opened.
- The stored record remains at its original title and revision.
- The interface resolves into the documented viewer state after permission rejection.

## False-pass traps

- Reloading before submission can remove the stale-form condition and weaken the test.
- Revoking the account session entirely would test authentication failure rather than a still-authenticated role downgrade.

## Cleanup

- Restore the disposable role and record through setup-owned cleanup hooks.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa hooks](/docs/agent-qa/guides/hooks.md)
- [agent-qa auth state](/docs/agent-qa/guides/auth-state.md)

- [Authorization and permission QA recipes](/agent-library/authorization.md)
- [Software factory QA library](/agent-library.md)
