org.objectweb.easybeans.security.api
Interface EZBSecurityContext

All Known Implementing Classes:
JOnASSecurityContext, SecurityContext

public interface EZBSecurityContext

Interface used to describe operations on a security context.

Author:
Florent Benoit

Method Summary
 void endsRunAs(javax.security.auth.Subject oldSubject)
          Ends the run-as mode and then restore the context stored by container.
 javax.security.auth.Subject enterRunAs(javax.security.auth.Subject runAsSubject)
          Enters in run-as mode with the given subject.
The previous subject is stored and will be restored when run-as mode will be ended.
 java.security.Principal getCallerPrincipal(boolean runAsBean)
          Gets the caller's principal.
 java.security.Principal[] getCallerRoles(boolean runAsBean)
          Gets the caller's roles.
 

Method Detail

getCallerPrincipal

java.security.Principal getCallerPrincipal(boolean runAsBean)
Gets the caller's principal.

Parameters:
runAsBean - if true, the bean is a run-as bean.
Returns:
principal of the caller.

enterRunAs

javax.security.auth.Subject enterRunAs(javax.security.auth.Subject runAsSubject)
Enters in run-as mode with the given subject.
The previous subject is stored and will be restored when run-as mode will be ended.

Parameters:
runAsSubject - the subject to used in run-as mode.
Returns:
the previous subject.

endsRunAs

void endsRunAs(javax.security.auth.Subject oldSubject)
Ends the run-as mode and then restore the context stored by container.

Parameters:
oldSubject - subject kept by container and restored.

getCallerRoles

java.security.Principal[] getCallerRoles(boolean runAsBean)
Gets the caller's roles.

Parameters:
runAsBean - if true, the bean is a run-as bean.
Returns:
array of roles of the caller.