public Object run() { SecurityContext.setCurrent( (SecurityContext) finv.getOldSecurityContext()); return null; } });
public Object run() { SecurityContext.setCurrent( (SecurityContext) finv.getOldSecurityContext()); return null; } });
setSecurityContext((SecurityContext) inv.getOldSecurityContext()); // always null
if (runAs != null) { ComponentInvocation ci = invMgr.getCurrentInvocation(); sc = (SecurityContext) ci.getOldSecurityContext(); } else { sc = SecurityContext.getCurrent();
if (runAs != null) { ComponentInvocation ci = invMgr.getCurrentInvocation(); sc = (SecurityContext) ci.getOldSecurityContext(); } else { sc = SecurityContext.getCurrent();
throw new InvocationException(); // 4646060 sc = (SecurityContext) ci.getOldSecurityContext();
/** * This method returns the Client Principal who initiated the current * Invocation. * * @return A Principal object of the client who made this invocation. * or null if the SecurityContext has not been established by the client. */ public Principal getCallerPrincipal() { SecurityContext sc = null; if (runAs != null) { // Run As // return the principal associated with the old security context ComponentInvocation ci = invMgr.getCurrentInvocation(); if (ci == null) { throw new InvocationException(); // 4646060 } sc = (SecurityContext) ci.getOldSecurityContext(); } else { // lets optimize a little. no need to look up oldsecctx // its the same as the new one sc = SecurityContext.getCurrent(); } Principal prin; if (sc != null) { prin = sc.getCallerPrincipal(); } else { prin = SecurityContext.getDefaultCallerPrincipal(); } return prin; }