public final class HumanCoffeeNetUser extends Object
CoffeeNetUserDetails.| Constructor and Description |
|---|
HumanCoffeeNetUser(String username,
String email,
Collection<org.springframework.security.core.GrantedAuthority> authorities) |
| Modifier and Type | Method and Description |
|---|---|
Collection<org.springframework.security.core.GrantedAuthority> |
getAuthorities() |
Set<String> |
getAuthoritiesAsString()
Returns the authorities as a string set.
|
String |
getEmail()
Returns the Email.
|
String |
getUsername()
Returns the username.
|
boolean |
hasRoles(String... roles)
Tests if the user has the provided roles.
|
boolean |
isCoffeeNetAdmin() |
boolean |
isMachineUser() |
String |
toString() |
public HumanCoffeeNetUser(String username, String email, Collection<org.springframework.security.core.GrantedAuthority> authorities)
username - Must not be null.email - Must not be null.authorities - Must not be null.public String getUsername()
CoffeeNetUserDetailspublic String getEmail()
CoffeeNetUserDetailspublic Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()
public boolean isCoffeeNetAdmin()
true if user is a CoffeeNet admin, otherwise falsepublic boolean isMachineUser()
true if user is a machine admin, otherwise falsepublic boolean hasRoles(String... roles)
CoffeeNetUserDetailshasRoles in interface CoffeeNetUserDetailsroles - totrue if user has all of the roles, otherwise falsepublic Set<String> getAuthoritiesAsString()
CoffeeNetUserDetailsgetAuthoritiesAsString in interface CoffeeNetUserDetailsCopyright © 2019 Pivotal Software, Inc.. All rights reserved.