if (!hasRole(roleType, group, groupType)) {
if (!isLoggedIn()) {
beanManager.fireEvent(new NotLoggedInEvent());
throw new NotLoggedInException();
} else {
beanManager.fireEvent(new NotAuthorizedEvent());
throw new AuthorizationException(String.format(
"Authorization check failed for role [%s:%s:%s]", roleType, group, groupType));
}
}
}