use of org.apache.directory.fortress.core.model.AdminRole in project directory-fortress-core by apache.
the class DelegatedMgrImplTest method searchAdminRoles.
/**
* @param msg
* @param srchValue
* @param rArray
*/
public static void searchAdminRoles(String msg, String srchValue, String[][] rArray) {
LogUtil.logIt(msg);
try {
DelReviewMgr dReviewMgr = getManagedDelegatedReviewMgr();
List<AdminRole> roles = dReviewMgr.findRoles(srchValue);
assertNotNull(roles);
assertTrue(CLS_NM + "searchAdminRoles list size check", rArray.length == roles.size());
for (String[] rle : rArray) {
int indx = roles.indexOf(AdminRoleTestData.getRole(rle));
if (indx != -1) {
AdminRole entity = roles.get(indx);
assertNotNull(entity);
AdminRoleTestData.assertEquals(entity, rle);
LOG.debug("searchAdminRoles [" + entity.getName() + "] successful");
} else {
msg = "searchAdminRoles srchValue [" + srchValue + "] failed list search";
LogUtil.logIt(msg);
fail(msg);
}
}
} catch (SecurityException ex) {
LOG.error("searchAdminRoles srchValue [" + srchValue + "] caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}
use of org.apache.directory.fortress.core.model.AdminRole in project directory-fortress-core by apache.
the class DelegatedAdminMgrConsole method addRoleAscendant.
/**
*/
void addRoleAscendant() {
try {
AdminRole cre = new AdminRole();
AdminRole pre = new AdminRole();
ReaderUtil.clearScreen();
System.out.println("Enter child adminRole name:");
cre.setName(ReaderUtil.readLn());
System.out.println("Enter parent adminRole name to add to repo:");
pre.setName(ReaderUtil.readLn());
System.out.println("Enter parent adminRole description:");
pre.setDescription(ReaderUtil.readLn());
dAmgr.addAscendant(cre, pre);
System.out.println("child adminRole [" + cre.getName() + "]");
System.out.println("parent adminRole [" + pre.getName() + "]");
System.out.println("parent adminRole and inheritance relationship has been added");
System.out.println("ENTER to continue");
} catch (SecurityException e) {
LOG.error("addRoleAscendant caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}
use of org.apache.directory.fortress.core.model.AdminRole in project directory-fortress-core by apache.
the class DelegatedAdminMgrConsole method addRoleInheritance.
/**
*/
void addRoleInheritance() {
try {
AdminRole cre = new AdminRole();
AdminRole pre = new AdminRole();
ReaderUtil.clearScreen();
System.out.println("Enter child adminRole name:");
cre.setName(ReaderUtil.readLn());
System.out.println("Enter parent adminRole name:");
pre.setName(ReaderUtil.readLn());
dAmgr.addInheritance(pre, cre);
System.out.println("child adminRole [" + cre.getName() + "]");
System.out.println("parent adminRole [" + pre.getName() + "]");
System.out.println("inheritance relationship has been added");
System.out.println("ENTER to continue");
} catch (SecurityException e) {
LOG.error("addRoleInheritance caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}
use of org.apache.directory.fortress.core.model.AdminRole in project directory-fortress-core by apache.
the class DelegatedAdminMgrConsole method addRoleDescendant.
/**
*/
void addRoleDescendant() {
try {
AdminRole cre = new AdminRole();
AdminRole pre = new AdminRole();
ReaderUtil.clearScreen();
System.out.println("Enter child adminRole name to add to repo:");
cre.setName(ReaderUtil.readLn());
System.out.println("Enter child adminRole description:");
cre.setDescription(ReaderUtil.readLn());
System.out.println("Enter parent adminRole name:");
pre.setName(ReaderUtil.readLn());
dAmgr.addDescendant(pre, cre);
System.out.println("child adminRole [" + cre.getName() + "]");
System.out.println("parent adminRole [" + pre.getName() + "]");
System.out.println("child adminRole and inheritance relationship has been added");
System.out.println("ENTER to continue");
} catch (SecurityException e) {
LOG.error("addRoleDescendant caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}
use of org.apache.directory.fortress.core.model.AdminRole in project directory-fortress-core by apache.
the class DelegatedReviewMgrConsole method assignedUsers.
/**
*/
void assignedUsers() {
try {
System.out.println("Enter admin role name:");
String name = ReaderUtil.readLn();
List<User> list = rm.assignedUsers(new AdminRole(name));
int i = 0;
for (User ue : list) {
System.out.println("USER[" + ++i + "]");
System.out.println(" userId [" + ue.getUserId() + "]");
System.out.println(" internalId [" + ue.getInternalId() + "]");
System.out.println(" description [" + ue.getDescription() + "]");
System.out.println(" common name [" + ue.getCn() + "]");
System.out.println(" surname [" + ue.getSn() + "]");
System.out.println(" orgUnitId [" + ue.getOu() + "]");
ReviewMgrConsole.printTemporal(ue, "USER");
System.out.println();
}
System.out.println("ENTER to continue");
} catch (SecurityException e) {
LOG.error("assignedUsers caught SecurityException rc=" + e.getErrorId() + ", msg=" + e.getMessage(), e);
}
ReaderUtil.readChar();
}
Aggregations