LOGGER.info("is Object-method; skipping");
return mi.proceed();
}
Subject subject = ThreadContext.getSubject();
if (subject == null || !subject.isAuthenticated()) {
throw new AccessDeniedException("no authentication was found in context");
}
if (subject.getPrincipal().getClass().equals(Object.class)) {
// this action is executed in a root-context
return mi.proceed();
}
String username = (String) subject.getPrincipal();
Access decisionResult = authorizer.checkAccess(username, mi);
if (decisionResult != Access.GRANTED) {
LOGGER.warn("Access denied because result was {}", decisionResult);
throw new AccessDeniedException();
}
LOGGER.debug("Access was granted");
return mi.proceed();
}