public Object intercept(final EasyBeansInvocationContext invocationContext) throws Exception {
String oldContextId = PolicyContext.getContextID();
boolean accessGranted = true;
boolean runAsBean = invocationContext.getFactory().getBeanInfo().getSecurityInfo().getRunAsRole() != null;
try {
EZBPermissionManager permissionManager = invocationContext.getFactory().getContainer().getPermissionManager();
if (permissionManager != null) {
accessGranted = permissionManager.checkSecurity(invocationContext, runAsBean);
}
} finally {
PolicyContext.setContextID(oldContextId);
}
if (!accessGranted) {