use of org.apache.directory.fortress.core.model.Role in project directory-fortress-core by apache.
the class Options method getRole.
/**
*/
public Role getRole() {
Role role = new Role();
role.setDescription(getDescription());
updateTemporal(role);
return role;
}
use of org.apache.directory.fortress.core.model.Role in project directory-fortress-core by apache.
the class AdminMgrImplTest method deleteInheritedRoles.
/**
* @param rArray
*/
public static void deleteInheritedRoles(String msg, String[][] rArray) {
LogUtil.logIt(msg);
try {
AdminMgr adminMgr = getManagedAdminMgr();
for (String[] rle : rArray) {
Role role = RoleTestData.getRole(rle);
Set<String> parents = RoleTestData.getRelationships(rle);
if (parents != null) {
for (String pRole : parents) {
adminMgr.deleteInheritance(new Role(pRole), role);
LOG.debug("deleteInheritedRoles child role [" + role.getName() + "] parent role [" + pRole + "] successful");
}
}
}
} catch (SecurityException ex) {
LOG.error("deleteInheritedRoles caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}
use of org.apache.directory.fortress.core.model.Role in project directory-fortress-core by apache.
the class AdminMgrImplTest method assignUsersH.
/**
* @param msg
* @param uArray
* @param rArray
* @param setTemporal
*/
public static void assignUsersH(String msg, String[][] uArray, String[][] rArray, boolean setTemporal) {
LogUtil.logIt(msg);
try {
AdminMgr adminMgr = getManagedAdminMgr();
int i = 0;
for (String[] usr : uArray) {
Role role = RoleTestData.getRole(rArray[i]);
UserRole uRole = new UserRole();
uRole.setUserId(UserTestData.getUserId(usr));
ConstraintUtil.copy(role, uRole);
adminMgr.assignUser(uRole);
i++;
}
} catch (SecurityException ex) {
LOG.error("assignUsersH user caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}
use of org.apache.directory.fortress.core.model.Role in project directory-fortress-core by apache.
the class AdminMgrImplTest method addSsdRoleMember.
/**
* @param sArray
*/
public static void addSsdRoleMember(String msg, String[][] sArray, String[][] rArray) {
LogUtil.logIt(msg);
try {
AdminMgr adminMgr = getManagedAdminMgr();
ReviewMgr reviewMgr = ReviewMgrImplTest.getManagedReviewMgr();
for (String[] ssdle : sArray) {
SDSet ssd = RoleTestData.getSDSet(ssdle);
SDSet entity = adminMgr.createSsdSet(ssd);
LOG.debug("addSsdRoleMember SSD [" + entity.getName() + "] successful");
for (String[] rle : rArray) {
Role role = RoleTestData.getRole(rle);
adminMgr.addSsdRoleMember(ssd, role);
List<SDSet> ssdSets = reviewMgr.ssdRoleSets(role);
assertNotNull(ssdSets);
assertTrue(CLS_NM + "addSsdRoleMember list size check", ssdSets.size() == 1);
SDSet ssd2 = ssdSets.get(0);
assertTrue(CLS_NM + "addSsdRoleMember SSD name check", ssd.getName().equals(ssd2.getName()));
assertTrue(CLS_NM + "addSsdRoleMember SSD role check", ssd2.getMembers().contains(role.getName()));
}
}
} catch (SecurityException ex) {
LOG.error("addSsdRoleMember caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}
use of org.apache.directory.fortress.core.model.Role in project directory-fortress-core by apache.
the class AdminMgrImplTest method deleteRoles.
/**
* @param rArray
*/
public static void deleteRoles(String msg, String[][] rArray) {
LogUtil.logIt(msg);
try {
AdminMgr adminMgr = getManagedAdminMgr();
for (String[] rle : rArray) {
Role role = new Role();
role.setName(RoleTestData.getName(rle));
adminMgr.deleteRole(role);
LOG.debug("deleteRoles role [" + role.getName() + "] successful");
}
} catch (SecurityException ex) {
LOG.error("deleteRoles caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}
Aggregations