// check username
UserDataVO userdata = userAdminSession.findUser(admin,username);
if(userdata == null){
String msg = intres.getLocalizedMessage("ra.errorentitynotexist", username);
throw new NotFoundException(msg);
}
// Check caid
int caid = userdata.getCAId();
caAdminSession.verifyExistenceOfCA(caid);
if(!authorizationSession.isAuthorizedNoLog(admin, AccessRulesConstants.CAPREFIX +caid)) {
Authorizer.throwAuthorizationException(admin, AccessRulesConstants.CAPREFIX +caid, null);
}
if (deleteUser) {
userAdminSession.revokeAndDeleteUser(admin,username,reason);
} else {
userAdminSession.revokeUser(admin,username,reason);
}
}catch(AuthorizationDeniedException e){
throw e;
} catch (FinderException e) {
throw new NotFoundException(e.getMessage());
} catch (RemoveException e) {
throw EjbcaWSHelper.getInternalException(e, logger);
} catch (RuntimeException e) { // EJBException, ClassCastException, ...
throw EjbcaWSHelper.getInternalException(e, logger);
} finally {