| java.lang.Object org.ow2.easybeans.security.propagation.context.SecurityContext
SecurityContext | final public class SecurityContext implements EZBSecurityContext,Serializable(Code) | | Security Context that is exchanged and propagated from clients to beans.
This is also why it is a serializable object (as it has to be exchanged).
The security contains allow to get the current principal and the roles
associated to this principal.
RunAs mode is managed by keeping the previous security context.
author: Florent Benoit |
Method Summary | |
public static Subject | buildSubject(String userName, String[] roleArray) Build a subject with the given user name and the list of roles.
Parameters: userName - given username Parameters: roleArray - given array of roles. | public static Subject | buildSubject(String userName, List<String> roleList) Build a subject with the given user name and the list of roles.
Parameters: userName - given username Parameters: roleList - given list of roles. | public void | endsRunAs(Subject oldSubject) Ends the run-as mode and then restore the context stored by container. | public 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. | public Principal | getCallerPrincipal(boolean runAsBean) Gets the caller's principal.
Parameters: runAsBean - if true, the bean is a run-as bean. | public Principal[] | getCallerRoles(boolean runAsBean) Gets the caller's roles.
Parameters: runAsBean - if true, the bean is a run-as bean. | public List<? extends Principal> | getCallerRolesList(boolean runAsBean) Gets the caller's roles.
Parameters: runAsBean - if true, the bean is a run-as bean. |
SecurityContext | public SecurityContext()(Code) | | Default private constructor.
|
SecurityContext | public SecurityContext(Subject subject)(Code) | | Build a security context with the given subject.
Parameters: subject - the given subject. |
buildSubject | public static Subject buildSubject(String userName, String[] roleArray)(Code) | | Build a subject with the given user name and the list of roles.
Parameters: userName - given username Parameters: roleArray - given array of roles. built subject. |
buildSubject | public static Subject buildSubject(String userName, List<String> roleList)(Code) | | Build a subject with the given user name and the list of roles.
Parameters: userName - given username Parameters: roleList - given list of roles. built subject. |
endsRunAs | public void endsRunAs(Subject oldSubject)(Code) | | Ends the run-as mode and then restore the context stored by container.
Parameters: oldSubject - subject kept by container and restored. |
enterRunAs | public Subject enterRunAs(Subject runAsSubject)(Code) | | 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. the previous subject. |
getCallerPrincipal | public Principal getCallerPrincipal(boolean runAsBean)(Code) | | Gets the caller's principal.
Parameters: runAsBean - if true, the bean is a run-as bean. principal of the caller. |
getCallerRoles | public Principal[] getCallerRoles(boolean runAsBean)(Code) | | Gets the caller's roles.
Parameters: runAsBean - if true, the bean is a run-as bean. array of roles of the caller. |
getCallerRolesList | public List<? extends Principal> getCallerRolesList(boolean runAsBean)(Code) | | Gets the caller's roles.
Parameters: runAsBean - if true, the bean is a run-as bean. list of roles of the caller. |
|
|