@Transactional
    public void updateClientPolicy(String organizationId, String clientId, String version,
        long policyId, UpdatePolicyBean bean) throws OrganizationNotFoundException,
        ClientVersionNotFoundException, PolicyNotFoundException, NotAuthorizedException {

        // Make sure the client version exists.
        ClientVersionBean cvb = getClientVersionInternal(organizationId, clientId, version);

        tryAction(() -> {
            PolicyBean policy = this.storage.getPolicy(PolicyType.Client, organizationId, clientId, version, policyId);
            if (policy == null) {
                throw ExceptionFactory.policyNotFoundException(policyId);
            }
            if (AuditUtils.valueChanged(policy.getConfiguration(), bean.getConfiguration())) {
                policy.setConfiguration(bean.getConfiguration());
                // TODO figure out what changed and include that in the audit entry
            }
            policy.setModifiedOn(new Date());
            policy.setModifiedBy(this.securityContext.getCurrentUser());
            storage.updatePolicy(policy);
            storage.createAuditEntry(AuditUtils.policyUpdated(policy, PolicyType.Client, securityContext));

            cvb.setModifiedOn(new Date());
            cvb.setModifiedBy(securityContext.getCurrentUser());
            storage.updateClientVersion(cvb);
        });
    }
Gets the client version internally
which lets callers dictate whether the user has clientView permission for the org.
@param organizationId the organizationId
@param clientId the clientId
@param version the version
@return the client version
@throws ClientVersionNotFoundException if client not found
manager/api/rest-impl/src/main/java/io/apiman/manager/api/service/ClientAppService.java