protected final class AnonymousProvider.AnonymousSecurityContext extends Object implements SecurityContext
| Modifier | Constructor and Description |
|---|---|
protected |
AnonymousSecurityContext(Set<String> userRoles,
String anonymousUsername) |
| 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.
|
public boolean isAnonymous()
SecurityContextisAnonymous in interface SecurityContextpublic String getUserName()
SecurityContextgetUserName in interface SecurityContextpublic boolean hasRole(String roleName)
SecurityContexthasRole in interface SecurityContextroleName - the name of the role to check. The name of the role will always come from ModeShape and will be one of
ModeShape's built-in roles.ModeShapeRolespublic void logout()
SecurityContextFor some authentication mechanisms, this will be implemented as a no-op.
logout in interface SecurityContextCopyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.