@Override
    public void approveContract(ContractActionDto action) throws ActionException, NotAuthorizedException {
        LOGGER.debug("Request approve contract {0} from {1}", action, securityContext.getCurrentUser());
        ContractBean contract = tryAction(() -> storage.getContract(action.getContractId()));
        // Should be a planAdmin in the org the plan was defined in (usually same org as the API is in!).
        OrganizationBean planOrg = contract.getPlan().getPlan().getOrganization();
        securityContext.checkPermissions(PermissionType.planAdmin, planOrg.getId());
        if (action.getStatus() == ContractStatus.Rejected) {
            actionService.rejectContract(action, securityContext.getCurrentUser());
        } else {
            actionService.approveContract(action, securityContext.getCurrentUser());
        }
    }
{@inheritDoc}
<p>
Workflow:
<ol>
    <li>Get specified contract.</li>
    <li>Verify if any other contracts still need approving:</li>
    <li>- If all approved, move to 'ready' state (or should we publish?).</li>
    <li>- If not all approved, leave in 'needs approval' state.</li>
</ol>
manager/api/rest-impl/src/main/java/io/apiman/manager/api/rest/impl/ActionResourceImpl.java