use of org.apache.directory.fortress.annotation.AdminPermissionOperation in project directory-fortress-core by apache.
the class ReviewMgrImpl method findRoleConstraints.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public List<RoleConstraint> findRoleConstraints(User user, Permission permission, RoleConstraint.RCType rcType) throws SecurityException {
String methodName = "findRoleConstraints";
assertContext(CLS_NM, methodName, user, GlobalErrIds.USER_NULL);
assertContext(CLS_NM, methodName, permission, GlobalErrIds.PERM_NULL);
checkAccess(CLS_NM, methodName);
// find roles this permission is authorized for
Permission pe = permP.read(permission);
Set<String> authorizedRoles = authorizeRoles(pe.getRoles());
// find role constraints for the user and the permission's pa set
return userP.findRoleConstraints(authorizedRoles, user, rcType, pe.getPaSets());
}
use of org.apache.directory.fortress.annotation.AdminPermissionOperation in project directory-fortress-core by apache.
the class ReviewMgrImpl method permissionUsers.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public List<String> permissionUsers(Permission perm) throws SecurityException {
String methodName = "permissionUsers";
assertContext(CLS_NM, methodName, perm, GlobalErrIds.PERM_OPERATION_NULL);
checkAccess(CLS_NM, methodName);
Permission pe = permP.read(perm);
List<String> retVals;
if (pe != null && CollectionUtils.isNotEmpty(pe.getUsers())) {
retVals = new ArrayList<>(pe.getUsers());
} else {
retVals = new ArrayList<>();
}
return retVals;
}
use of org.apache.directory.fortress.annotation.AdminPermissionOperation in project directory-fortress-core by apache.
the class ReviewMgrImpl method ssdRoleSetCardinality.
/**
* {@inheritDoc}
*/
@Override
@AdminPermissionOperation
public int ssdRoleSetCardinality(SDSet ssd) throws SecurityException {
String methodName = "ssdRoleSetCardinality";
assertContext(CLS_NM, methodName, ssd, GlobalErrIds.SSD_NULL);
checkAccess(CLS_NM, methodName);
SDSet se = ssdP.read(ssd);
return se.getCardinality();
}
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<UserRole> assignedRoles(User user) throws SecurityException {
String methodName = "assignedRoles";
assertContext(CLS_NM, methodName, user, GlobalErrIds.USER_NULL);
checkAccess(CLS_NM, methodName);
User ue = userP.read(user, true);
return ue.getRoles();
}
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<String> findRoles(String searchVal, int limit) 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, limit);
}
Aggregations