


I am able to create a user and a policy using Java EJB, but I cannot find how to apply a user to a policy. Any help on this would be appreaciated.
Views
Replies
Sign in to like this content
Total Likes
//Create a PolicyEntry object
PolicyEntry policyEntry = InfomodelObjectFactory.createPolicyEntry();
//Add the user to it as a principal
policyEntry.setPrincipal(principal);
//Give permissions
Permission perm = InfomodelObjectFactory.createPermission(Permission.COPY);
policyEntry.addPermission(perm);
// Add the policyEntry object to the policy
policy.addPolicyEntry(policyEntry);
//Update or register policy
policyManager.registerPolicy(policy, policySetName);//if creating a new policy
policyManager.updatePolicy(policy);//if updating an existing policy
Views
Replies
Total Likes