use of org.apache.directory.fortress.core.ReviewMgr in project directory-fortress-core by apache.
the class AuditMgrImpl method searchAdminMods.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public List<Mod> searchAdminMods(UserAudit uAudit) throws SecurityException {
String methodName = "searchAdminMods";
assertContext(CLS_NM, methodName, uAudit, GlobalErrIds.AUDT_INPUT_NULL);
checkAccess(CLS_NM, methodName);
if (StringUtils.isNotEmpty(uAudit.getUserId())) {
ReviewMgr rMgr = ReviewMgrFactory.createInstance(this.contextId);
User user = rMgr.readUser(new User(uAudit.getUserId()));
uAudit.setInternalUserId(user.getInternalId());
}
return auditP.searchAdminMods(uAudit);
}
use of org.apache.directory.fortress.core.ReviewMgr in project directory-fortress-core by apache.
the class GroupMgrImpl method loadUserDn.
private void loadUserDn(User inUser) throws SecurityException {
ReviewMgr reviewMgr = ReviewMgrFactory.createInstance(this.contextId);
User outUser = reviewMgr.readUser(inUser);
inUser.setDn(outUser.getDn());
}
use of org.apache.directory.fortress.core.ReviewMgr in project directory-fortress-core by apache.
the class GroupMgrImpl method assign.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public Group assign(Group group, String member) throws SecurityException {
String methodName = "assign";
assertContext(CLS_NM, methodName, group, GlobalErrIds.GROUP_NULL);
checkAccess(CLS_NM, methodName);
ReviewMgr reviewMgr = ReviewMgrFactory.createInstance(this.contextId);
String dn;
if (group.getType() == Group.Type.ROLE) {
Role inRole = new Role(member);
inRole.setContextId(group.getContextId());
Role role = reviewMgr.readRole(inRole);
dn = role.getDn();
// Validate SSD constraints
SDUtil.getInstance().validateSSD(group, role);
} else {
User inUser = new User(member);
inUser.setContextId(group.getContextId());
User user = reviewMgr.readUser(inUser);
dn = user.getDn();
}
return groupP.assign(group, dn);
}
use of org.apache.directory.fortress.core.ReviewMgr in project directory-fortress-core by apache.
the class GroupMgrImpl method deassign.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public Group deassign(Group group, String member) throws SecurityException {
String methodName = "deassign";
assertContext(CLS_NM, methodName, group, GlobalErrIds.GROUP_NULL);
checkAccess(CLS_NM, methodName);
ReviewMgr reviewMgr = ReviewMgrFactory.createInstance(this.contextId);
String dn;
if (group.getType() == Group.Type.ROLE) {
Role role = reviewMgr.readRole(new Role(member));
dn = role.getDn();
} else {
User user = reviewMgr.readUser(new User(member));
dn = user.getDn();
}
return groupP.deassign(group, dn);
}
use of org.apache.directory.fortress.core.ReviewMgr in project directory-fortress-core by apache.
the class GroupMgrImpl method loadRoleDns.
private void loadRoleDns(Group group) throws SecurityException {
if (CollectionUtils.isNotEmpty(group.getMembers())) {
ReviewMgr reviewMgr = ReviewMgrFactory.createInstance(this.contextId);
List<String> roleDns = new ArrayList<String>();
for (String member : group.getMembers()) {
Role role = reviewMgr.readRole(new Role(member));
roleDns.add(role.getDn());
}
group.setMembers(roleDns);
}
}
Aggregations