CodamAIDocs
Topicdone

Approval chains

Stages per scope, who approves at which stage, the four-eyes principle, what an approval means, and where a project defines its chains.

Variants
No stages: publish directlyOne stageSeveral stagesREVIEWEDAPPROVED

What this is about

An approval chain sets who must review a submitted revision before it renders. It consists of stages that run one after the other. Every stage names a CIAS role. Whoever has this role may approve at this stage.

A stage

EntryMeaningDefault
namewhat the stage is called, for people, at most 64 characters— (required)
rolethe CIAS role that approves at this stage— (required)
minimum-approvershow many different people approve before the stage is done1
author-excludedwhether the person who submitted is excluded heretrue
meaningwhat an approval states here: REVIEWED (checked) or APPROVED (released)— (required)

The meaning is in the chain together with person and time. So every approval says explicitly whether someone only reviewed the content or released it. Rules such as 21 CFR Part 11 ask exactly that of a signature.

The way through the stages

Two stages: review the content, then release
  1. User
    Stage 1: Subject review
    Role report-reviewer, not the author, at least 1 person
    ↳ no The revision stays in review, or someone rejects it
  2. User
    Stage 2: Release
    Role quality-lead, not the author, at least 2 people
    ↳ no The revision stays in review, or someone rejects it
  3. The revision is PUBLISHED, the previous one becomes SUPERSEDED

The stages run in their order. As long as stage 1 is not done, nobody can approve stage 2. Whoever has the role of stage 2 but not the one of stage 1 has to wait.

What is checked on an approval

POST /crms/revisions/{revision}/approve has no body. Who approves comes from the token.

Revision in review?Already approved?Role of the current stage?Author, and the stage excludes them?What happens
no–––409 template-revision-not-in-review
yesyes––409 approval-already-given
yesnono–403 approval-role-missing
yesnoyesyes403 approval-author-excluded
yesnoyesnoThe approval counts. If it is the last approval needed at the last stage, the revision is published

“Already approved” means: this person has already approved this revision once, at any stage. A person approves a revision only once, even if they have the roles of several stages. Otherwise two stages with the same person would be only one pair of eyes.

Who can see a revision at all

Only someone who can reach the revision can approve it:

  • System templates: every person with the role of the stage.
  • Tenant templates: people of the same tenant with the role of the stage.
  • Person templates: the reviewers of this person’s tenant. They cannot see the template otherwise, but they review it.

For everyone else the revision does not exist: 404 template-not-found.

Rejecting

POST /crms/revisions/{revision}/reject with {"reason": "…"}. Whoever has the role of the current stage may reject. The reason is always required. A rejection ends the review at once, at whatever stage. What happens next is described in Life cycle.

Where the chains are defined

The chains belong to the project. You define them in the hub on the project’s CRMS module, in the area “Approval”, field approvalStages. There, every stage also has a scope (USER, TENANT or SYSTEM) and a sortOrder for the order.

On the build, the generator writes the file crms-configuration.yaml from it:

codamai:
  crms:
    template:
      approval:
        tenant:
          - name: Subject review
            role: report-reviewer
            meaning: REVIEWED
          - name: Release
            role: quality-lead
            minimum-approvers: 2
            meaning: APPROVED

A scope missing from the file has no stages. In the example, person and system templates are therefore published at once, tenant templates go through two stages.

The chain is stored in the revision

On submit, CRMS writes the whole chain that applies at that moment into the REVISION entry. The revision runs through exactly these stages. If a new build brings another chain, it only applies to revisions submitted afterwards. So the chain of every revision can still be proven later.

Pitfalls

Next

Search