Context Inheritance
AXAG supports context inheritance — child elements inherit scope, tenant, and role context from parent containers.
Inheritance Rules
axag-scopeon a parent element applies to all child annotationsaxag-tenant-contexton a parent element applies to all childrenaxag-required-roleson a parent element constrains all children- Child elements MAY override inherited context with more restrictive values
- Child elements MUST NOT override inherited context with less restrictive values
Example
<section axag-scope="tenant" axag-tenant-context="acme-corp" axag-required-roles='["admin"]'>
<!-- Both buttons inherit scope="tenant", tenant-context="acme-corp", required-roles=["admin"] -->
<button axag-intent="user.create" axag-entity="user" axag-action-type="create">Add User</button>
<button axag-intent="user.delete" axag-entity="user" axag-action-type="delete"
axag-required-roles='["super_admin"]'>Delete User</button>
<!-- Delete overrides to require super_admin (more restrictive) — valid -->
</section>