public Object checkPermission(InvocationContext ic) throws Exception {
String[] rolesAllowed = this.extractMethodRoles(ic.getMethod());
if (rolesAllowed != null && rolesAllowed.length > 0) {
if (!this.checkUserPermissions(rolesAllowed)) {
String cause = getFatalMessage(ic.getMethod().getAnnotation(SecurityMethod.class).message());
BusinessException be = new BusinessException(cause);
be.setSeverity(FacesMessage.SEVERITY_FATAL);
be.setSummary(cause);
throw be;
}
}
return ic.proceed();
}