use of org.apache.directory.fortress.core.model.AdminRole in project directory-fortress-core by apache.
the class DelegatedReviewMgrConsole method findRoles.
void findRoles() {
ReaderUtil.clearScreen();
try {
System.out.println("Enter value to search AdminRoles with:");
String val = ReaderUtil.readLn();
List<AdminRole> list = rm.findRoles(val);
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
AdminRole re = list.get(i);
System.out.println("ADMIN ROLE OBJECT [" + i + "]:");
System.out.println(" name [" + re.getName() + "]");
System.out.println(" internalId [" + re.getId() + "]");
System.out.println(" description [" + re.getDescription() + "]");
System.out.println(" osU [" + re.getOsUSet() + "]");
System.out.println(" osP [" + re.getOsPSet() + "]");
ReviewMgrConsole.printTemporal(re, "ADMINROLE");
}
} else {
System.out.println("name [" + val + "] was not found");
}
System.out.println("ENTER to continue");
} catch (SecurityException e) {
LOG.error("findRoles 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 PropertyMgrImplTest method testCrudProperties.
public void testCrudProperties() {
Role role = RoleTestData.getRole(RoleTestData.ROLES_TR1[0]);
AdminRole adminRole = AdminRoleTestData.getRole(AdminRoleTestData.AROLES_TR1[0]);
PermObj permObj = PermTestData.getObj(PermTestData.OBJS_TOB1[0]);
Permission permOp = PermTestData.getOp(permObj.getObjName(), PermTestData.OPS_TOP1[0]);
Group group = GroupTestData.TEST_GROUP1;
addProperties("ADD-PROP-RLE", role, PROPS);
addProperties("ADD-PROP-ADMRLE", adminRole, PROPS);
addProperties("ADD-PROP-POBJ", permObj, PROPS);
addProperties("ADD-PROP-POP", permOp, PROPS);
addProperties("ADD-PROP-GRP", group, PROPS);
updateProperties("UPD-PROP-RLE", role, PROPS_UPDATED[0]);
updateProperties("UPD-PROP-ADMRLE", adminRole, PROPS_UPDATED[0]);
updateProperties("UPD-PROP-POBJ", permObj, PROPS_UPDATED[0]);
updateProperties("UPD-PROP-POP", permOp, PROPS_UPDATED[0]);
updateProperties("UPD-PROP-POP", group, PROPS_UPDATED[0]);
deleteProperties("DEL-PROP-RLE", role, PROPS_UPDATED[0]);
deleteProperties("DEL-PROP-ADMRLE", adminRole, PROPS_UPDATED[0]);
deleteProperties("DEL-PROP-POBJ", permObj, PROPS_UPDATED[0]);
deleteProperties("DEL-PROP-POP", permOp, PROPS_UPDATED[0]);
deleteProperties("DEL-PROP-POP", group, PROPS_UPDATED[0]);
}
use of org.apache.directory.fortress.core.model.AdminRole in project directory-fortress-core by apache.
the class AdminRoleTestData method getRoleConstraint.
private static Constraint getRoleConstraint(String[] rle) {
AdminRole role = new AdminRole();
role.setBeginDate(RoleTestData.getBeginDate(rle));
role.setEndDate(RoleTestData.getEndDate(rle));
role.setBeginLockDate(RoleTestData.getBeginLockDate(rle));
role.setEndLockDate(RoleTestData.getEndLockDate(rle));
role.setBeginTime(RoleTestData.getBeginTime(rle));
role.setEndTime(RoleTestData.getEndTime(rle));
role.setDayMask(RoleTestData.getDayMask(rle));
role.setTimeout(RoleTestData.getTimeOut(rle));
return role;
}
use of org.apache.directory.fortress.core.model.AdminRole in project directory-fortress-core by apache.
the class DelegatedMgrImplTest method updateAdminRoles.
/**
* @param msg
* @param rArray
*/
public static void updateAdminRoles(String msg, String[][] rArray, boolean isAdmin) {
LogUtil.logIt(msg);
try {
DelAdminMgr dAdminMgr;
if (isAdmin) {
dAdminMgr = getManagedDelegatedMgr();
} else {
dAdminMgr = DelAdminMgrFactory.createInstance(TestUtils.getContext());
}
for (String[] rle : rArray) {
AdminRole role = AdminRoleTestData.getRole(rle);
AdminRole entity = dAdminMgr.updateRole(role);
LOG.debug("updateAdminRoles role [" + entity.getName() + "] successful");
}
} catch (SecurityException ex) {
LOG.error("updateAdminRoles 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 DelegatedMgrImplTest method deleteAdminRoles.
/**
* @param rArray
*/
private void deleteAdminRoles(String msg, String[][] rArray, boolean isAdmin) {
LogUtil.logIt(msg);
try {
DelAdminMgr dAdminMgr;
if (isAdmin) {
dAdminMgr = getManagedDelegatedMgr();
} else {
dAdminMgr = DelAdminMgrFactory.createInstance(TestUtils.getContext());
}
for (String[] rle : rArray) {
AdminRole role = new AdminRole();
role.setName(RoleTestData.getName(rle));
dAdminMgr.deleteRole(role);
LOG.debug("deleteAdminRoles role [" + role.getName() + "] successful");
}
} catch (SecurityException ex) {
LOG.error("deleteAdminRoles caught SecurityException rc=" + ex.getErrorId() + ", msg=" + ex.getMessage(), ex);
fail(ex.getMessage());
}
}
Aggregations