org.ow2.easybeans.security.api
Interface EZBSecurityContext


public interface EZBSecurityContext

Interface used to describe operations on a security context.

Author:
Florent Benoit

Method Summary
 void endsRunAs(Subject oldSubject)
          Ends the run-as mode and then restore the context stored by container.
 Subject enterRunAs(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.
 Principal getCallerPrincipal(boolean runAsBean)
          Gets the caller's principal.
 Principal[] getCallerRoles(boolean runAsBean)
          Gets the caller's roles.
 

Method Detail

getCallerPrincipal

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

Subject enterRunAs(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(Subject oldSubject)
Ends the run-as mode and then restore the context stored by container.

Parameters:
oldSubject - subject kept by container and restored.

getCallerRoles

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.


Copyright © 2006-2012 OW2 Consortium. All Rights Reserved.