// make sure Endpoint Authentication is turned on
if((Boolean)applicationContext.getAttribute(ApplicationContext.SETTINGS_ENDPOINT_AUTH) == false) {
return;
}
Endpoint endpoint = null;
if(Enhancer.isEnhanced(target)) {
endpoint = target.getSuperclass().getAnnotation(Endpoint.class);
} else {
endpoint = target.getAnnotation(Endpoint.class);
}
// make sure its authenicated
if(endpoint.authenticated() && !service.isActive(userid, token).equals(SessionStatus.AUTHENTICATED)) {
throw new SherpaPermissionExcpetion("User status [" + service.isActive(userid, token) + "]", service.isActive(userid, token).toString());
}
}