use of org.apache.directory.fortress.annotation.AdminPermissionOperation in project directory-fortress-core by apache.
the class ReviewMgrImpl method assignedRoles.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public List<String> assignedRoles(String userId) throws SecurityException {
String methodName = "assignedRoles";
VUtil.assertNotNullOrEmpty(userId, GlobalErrIds.USER_NULL, CLS_NM + "." + methodName);
checkAccess(CLS_NM, methodName);
User user = new User(userId);
user.setContextId(this.contextId);
return userP.getAssignedRoles(user);
}
use of org.apache.directory.fortress.annotation.AdminPermissionOperation in project directory-fortress-core by apache.
the class ReviewMgrImpl method authorizedRoles.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public Set<String> authorizedRoles(User user) throws SecurityException {
String methodName = "authorizedRoles";
assertContext(CLS_NM, methodName, user, GlobalErrIds.USER_NULL);
checkAccess(CLS_NM, methodName);
User ue = userP.read(user, true);
List<UserRole> roles = ue.getRoles();
Set<String> iRoles = null;
if (CollectionUtils.isNotEmpty(roles)) {
iRoles = RoleUtil.getInstance().getInheritedRoles(roles, this.contextId);
}
return iRoles;
}
use of org.apache.directory.fortress.annotation.AdminPermissionOperation in project directory-fortress-core by apache.
the class ReviewMgrImpl method findRoles.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public List<Role> findRoles(String searchVal) throws SecurityException {
String methodName = "findRoles";
VUtil.assertNotNull(searchVal, GlobalErrIds.ROLE_NM_NULL, CLS_NM + "." + methodName);
checkAccess(CLS_NM, methodName);
Role role = new Role(searchVal);
role.setContextId(this.contextId);
return roleP.search(role);
}
use of org.apache.directory.fortress.annotation.AdminPermissionOperation in project directory-fortress-core by apache.
the class ReviewMgrImpl method authorizedPermissionRoles.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public Set<String> authorizedPermissionRoles(Permission perm) throws SecurityException {
Set<String> authorizedRoles;
String methodName = "authorizedPermissionRoles";
assertContext(CLS_NM, methodName, perm, GlobalErrIds.PERM_OPERATION_NULL);
checkAccess(CLS_NM, methodName);
// Pull the permission from ldap:
Permission pe = permP.read(perm);
// Get all roles that this permission is authorized for:
authorizedRoles = authorizeRoles(pe.getRoles());
return authorizedRoles;
}
use of org.apache.directory.fortress.annotation.AdminPermissionOperation in project directory-fortress-core by apache.
the class ReviewMgrImpl method ssdRoleSetRoles.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public Set<String> ssdRoleSetRoles(SDSet ssd) throws SecurityException {
String methodName = "ssdRoleSetRoles";
assertContext(CLS_NM, methodName, ssd, GlobalErrIds.SSD_NULL);
checkAccess(CLS_NM, methodName);
ssd.setType(SDSet.SDType.STATIC);
SDSet se = ssdP.read(ssd);
return se.getMembers();
}
Aggregations