Search in sources :

Example 6 with PolicyPrivilegeManager

use of com.sun.identity.entitlement.opensso.PolicyPrivilegeManager in project OpenAM by OpenRock.

the class OpenProvisioning method cleanup.

@AfterClass
public void cleanup() throws SSOException, IdRepoException, EntitlementException {
    SSOToken adminToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
    AMIdentityRepository amir = new AMIdentityRepository(adminToken, "/");
    Set<AMIdentity> identities = new HashSet<AMIdentity>();
    identities.add(jSmith);
    identities.add(johnDoe);
    identities.add(branchMgr);
    amir.deleteIdentities(identities);
    PrivilegeManager pMgr = new PolicyPrivilegeManager(applicationServiceFactory, resourceTypeService, constraintValidator);
    pMgr.initialize("/", SubjectUtils.createSubject(adminToken));
    pMgr.remove(PRIVILEGE_NAME);
}
Also used : SSOToken(com.iplanet.sso.SSOToken) PolicyPrivilegeManager(com.sun.identity.entitlement.opensso.PolicyPrivilegeManager) PrivilegeManager(com.sun.identity.entitlement.PrivilegeManager) AMIdentity(com.sun.identity.idm.AMIdentity) AMIdentityRepository(com.sun.identity.idm.AMIdentityRepository) PolicyPrivilegeManager(com.sun.identity.entitlement.opensso.PolicyPrivilegeManager) HashSet(java.util.HashSet) AfterClass(org.testng.annotations.AfterClass)

Aggregations

PolicyPrivilegeManager (com.sun.identity.entitlement.opensso.PolicyPrivilegeManager)6 HashMap (java.util.HashMap)3 HashSet (java.util.HashSet)3 AfterClass (org.testng.annotations.AfterClass)3 PrivilegeManager (com.sun.identity.entitlement.PrivilegeManager)2 AMIdentity (com.sun.identity.idm.AMIdentity)2 ConstraintValidator (org.forgerock.openam.entitlement.constraints.ConstraintValidator)2 ApplicationServiceFactory (org.forgerock.openam.entitlement.service.ApplicationServiceFactory)2 ResourceTypeService (org.forgerock.openam.entitlement.service.ResourceTypeService)2 BeforeClass (org.testng.annotations.BeforeClass)2 SSOToken (com.iplanet.sso.SSOToken)1 AttributeLookupCondition (com.sun.identity.entitlement.AttributeLookupCondition)1 Entitlement (com.sun.identity.entitlement.Entitlement)1 Privilege (com.sun.identity.entitlement.Privilege)1 UserSubject (com.sun.identity.entitlement.UserSubject)1 OpenSSOGroupSubject (com.sun.identity.entitlement.opensso.OpenSSOGroupSubject)1 OpenSSOUserSubject (com.sun.identity.entitlement.opensso.OpenSSOUserSubject)1 AMIdentityRepository (com.sun.identity.idm.AMIdentityRepository)1 Set (java.util.Set)1