@NotThreadSafe public interface SecurityContext
A security context should only be associated with the execution context after authentication has occurred.
Modifier and Type | Method and Description |
---|---|
String |
getUserName()
Returns the authenticated user's name
|
boolean |
hasRole(String roleName)
Returns whether the authenticated user has the given role.
|
boolean |
isAnonymous()
Return whether this security context is an anonymous context.
|
void |
logout()
Logs the user out of the authentication mechanism.
|
boolean isAnonymous()
String getUserName()
boolean hasRole(String roleName)
roleName
- the name of the role to checkvoid logout()
For some authentication mechanisms, this will be implemented as a no-op.
Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.