Methods Summary |
---|
protected org.jboss.security.RunAsIdentity | getAnnotationRunAsIdentity(org.jboss.aop.joinpoint.Invocation invocation)
RunAs runAs = (RunAs) invocation.resolveAnnotation(RunAs.class);
if (runAs == null) return null;
RunAsIdentity runAsRole = new RunAsIdentity(runAs.value(), null);
return runAsRole;
|
public java.lang.String | getName() return "RunAsSecurityInterceptor";
|
protected org.jboss.security.RunAsIdentity | getRunAsIdentity(org.jboss.aop.joinpoint.Invocation invocation)
RunAsIdentity identity = (RunAsIdentity)invocation.getMetaData("security", "run-as");
if (identity == null) identity = getAnnotationRunAsIdentity(invocation);
return identity;
|
public java.lang.Object | invoke(org.jboss.aop.joinpoint.Invocation invocation)
RunAsIdentity runAsRole = getRunAsIdentity(invocation);
// If a run-as role was specified, push it so that any calls made
// by this bean will have the runAsRole available for declarative
// security checks.
if(runAsRole != null)
{
SecurityActions.pushRunAsIdentity(runAsRole);
}
try
{
return invocation.invokeNext();
}
finally
{
if(runAsRole != null)
{
SecurityActions.popRunAsIdentity();
}
}
|