.getInstance(getGovernanceUserRegistry(), CarbonContext.getCurrentContext().getTenantId());
policyObj = PolicyReader.getInstance(null, null).getPolicy(policy.getPolicy());
if (policyObj != null) {
policyAdmin = new PolicyAdmin(new PolicyStore(getGovernanceUserRegistry()));
policy.setPolicyId(policyObj.getId().toASCIIString());
policyAdmin.addOrUpdatePolicy(policy);
// Reload the policies to the memory.
entitlementEngine.getRegistryModule().init(null);
} else {
throw new IdentityException("Invalid Policy");
}