use of org.apache.directory.fortress.core.AdminMgr in project directory-fortress-core by apache.
the class DelAdminMgrImpl method updateRole.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public AdminRole updateRole(AdminRole role) throws SecurityException {
String methodName = "updateRole";
assertContext(CLS_NM, methodName, role, GlobalErrIds.ARLE_NULL);
setEntitySession(CLS_NM, methodName, role);
AdminRole re = admRP.update(role);
// search for all users assigned this role and update:
List<User> users = userP.getAssignedUsers(role);
if (CollectionUtils.isNotEmpty(users)) {
final AdminMgr aMgr = AdminMgrFactory.createInstance(this.contextId);
for (User ue : users) {
User upUe = new User(ue.getUserId());
setAdminData(CLS_NM, methodName, upUe);
List<UserAdminRole> uaRoles = ue.getAdminRoles();
UserAdminRole chgRole = new UserAdminRole();
chgRole.setName(role.getName());
chgRole.setUserId(ue.getUserId());
chgRole.setOsPSet(role.getOsPSet());
chgRole.setOsUSet(role.getOsUSet());
uaRoles.remove(chgRole);
ConstraintUtil.copy(re, chgRole);
uaRoles.add(chgRole);
upUe.setUserId(ue.getUserId());
upUe.setAdminRole(chgRole);
aMgr.updateUser(upUe);
}
}
return re;
}
use of org.apache.directory.fortress.core.AdminMgr in project directory-fortress-core by apache.
the class DelAdminMgrImpl method addPermObj.
/**
* {@inheritDoc}
*/
@Override
public PermObj addPermObj(PermObj pObj) throws SecurityException {
final AdminMgr adminMgr = AdminMgrFactory.createInstance(this.contextId);
pObj.setAdmin(true);
return adminMgr.addPermObj(pObj);
}
use of org.apache.directory.fortress.core.AdminMgr in project directory-fortress-core by apache.
the class DelAdminMgrImpl method addPermission.
/**
* {@inheritDoc}
*/
@Override
public Permission addPermission(Permission perm) throws SecurityException {
final AdminMgr adminMgr = AdminMgrFactory.createInstance(this.contextId);
perm.setAdmin(true);
return adminMgr.addPermission(perm);
}
use of org.apache.directory.fortress.core.AdminMgr in project directory-fortress-core by apache.
the class DelAdminMgrImpl method updatePermObj.
/**
* {@inheritDoc}
*/
@Override
public PermObj updatePermObj(PermObj pObj) throws SecurityException {
final AdminMgr adminMgr = AdminMgrFactory.createInstance(this.contextId);
pObj.setAdmin(true);
return adminMgr.updatePermObj(pObj);
}
use of org.apache.directory.fortress.core.AdminMgr in project directory-fortress-core by apache.
the class DelAdminMgrImpl method deletePermission.
/**
* {@inheritDoc}
*/
@Override
public void deletePermission(Permission perm) throws SecurityException {
final AdminMgr adminMgr = AdminMgrFactory.createInstance(this.contextId);
perm.setAdmin(true);
adminMgr.deletePermission(perm);
}
Aggregations