@Portable public class UserImpl extends Object implements User, Serializable
User
, used by Errai's PicketLink and
Keycloak integration modules. On the client, Errai should never reference
this type directly. The interface should be used instead to provide the
ability to plug in custom User
implementations.
Errai, by default, assigns no semantics to groups. Only roles are relevant
when checking permissions.User.StandardUserProperties
Constructor and Description |
---|
UserImpl(String name) |
UserImpl(String name,
Collection<? extends Role> roles) |
UserImpl(String name,
Collection<? extends Role> roles,
Collection<? extends Group> groups) |
UserImpl(String name,
Collection<? extends Role> roles,
Collection<? extends Group> groups,
Map<String,String> properties) |
UserImpl(String name,
Collection<? extends Role> roles,
Map<String,String> properties) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
Set<Group> |
getGroups()
The implementation returned must use the
Object.equals(Object) method for comparison. |
String |
getIdentifier() |
Map<String,String> |
getProperties()
Note: the contents of this map will depend on the implementations of
User and
AuthenticationService being used. |
String |
getProperty(String name) |
Set<Role> |
getRoles()
The implementation returned must use the
Object.equals(Object) method for comparison. |
boolean |
hasAllGroups(String... groupNames) |
boolean |
hasAllRoles(String... roleNames) |
boolean |
hasAnyGroups(String... groupNames) |
boolean |
hasAnyRoles(String... roleNames) |
int |
hashCode() |
void |
removeProperty(String name) |
void |
setProperty(String name,
String value) |
String |
toString() |
public UserImpl(String name)
public UserImpl(String name, Collection<? extends Role> roles)
public UserImpl(String name, Collection<? extends Role> roles, Map<String,String> properties)
public UserImpl(String name, Collection<? extends Role> roles, Collection<? extends Group> groups)
public UserImpl(String name, Collection<? extends Role> roles, Collection<? extends Group> groups, Map<String,String> properties)
public Set<Role> getRoles()
User
Object.equals(Object)
method for comparison.public boolean hasAllRoles(String... roleNames)
public boolean hasAnyRoles(String... roleNames)
public Set<Group> getGroups()
User
Object.equals(Object)
method for comparison.public boolean hasAllGroups(String... groupNames)
public boolean hasAnyGroups(String... groupNames)
public Map<String,String> getProperties()
User
User
and
AuthenticationService
being used.getProperties
in interface User
public void setProperty(String name, String value)
setProperty
in interface User
name
- The name of a property to set.value
- The value to set. This will override any pre-existing value.public void removeProperty(String name)
removeProperty
in interface User
name
- The name of a property to remove.public String getProperty(String name)
getProperty
in interface User
name
- The name of a property to get the value of.null
if there is no such property in the
User.getProperties()
map.public String getIdentifier()
getIdentifier
in interface User
Copyright © 2013-2015 JBoss, a division of Red Hat. All Rights Reserved.