Package com.avoka.fc.core.security
Class AccountUserDetails
- java.lang.Object
-
- com.avoka.fc.core.security.AccountUserDetails
-
- All Implemented Interfaces:
Serializable
,org.springframework.security.core.userdetails.UserDetails
public class AccountUserDetails extends Object implements org.springframework.security.core.userdetails.UserDetails
Provides an AccountUser UserDetails adaptor.- See Also:
UserAccount
,UserDetails
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AccountUserDetails(UserAccount userAccount)
Create a new UserDetailsAdaptor object based on the given user account.AccountUserDetails(UserAccount userAccount, Collection<org.springframework.security.core.GrantedAuthority> authorities)
Create a new UserDetailsAdaptor object based on the given user account.AccountUserDetails(UserAccount userAccount, Set<String> groupNames)
Create a new UserDetailsAdaptor object based on the given user account and groups (granted authorities).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<org.springframework.security.core.GrantedAuthority>
getAuthorities()
Return the list of authorities associated with the userString
getPassword()
Return the password.String
getPasswordSalt()
Return the password salt if defined.UserAccount
getUserAccount()
Return the underlying user account.String
getUsername()
Return the user login name or principal.boolean
isAccountNonExpired()
Return whether the account has not yet expired (currently always returns true).boolean
isAccountNonLocked()
Return whether the account has not been locked.boolean
isCredentialsNonExpired()
Return whether the account credentials have not yet expired (currently always returns true)boolean
isEnabled()
Return whether the account is enabled.
-
-
-
Constructor Detail
-
AccountUserDetails
public AccountUserDetails(UserAccount userAccount, Collection<org.springframework.security.core.GrantedAuthority> authorities)
Create a new UserDetailsAdaptor object based on the given user account.- Parameters:
userAccount
- a valid system user account (required)authorities
- the granted user authorities or groups the user belongs to- Since:
- 3.6.0
-
AccountUserDetails
public AccountUserDetails(UserAccount userAccount)
Create a new UserDetailsAdaptor object based on the given user account.- Parameters:
userAccount
- a valid system user account (required)- Since:
- 3.6.0
-
AccountUserDetails
public AccountUserDetails(UserAccount userAccount, Set<String> groupNames)
Create a new UserDetailsAdaptor object based on the given user account and groups (granted authorities).- Parameters:
userAccount
- a valid system user accountgroupNames
- the names of the groups (granted authorities)
-
-
Method Detail
-
getAuthorities
public Collection<org.springframework.security.core.GrantedAuthority> getAuthorities()
Return the list of authorities associated with the user- Specified by:
getAuthorities
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- an array containing
GrantedAuthorityAdaptor
objects representing SmartForm Manager roles - See Also:
UserDetails.getAuthorities()
-
getPassword
public String getPassword()
Return the password.- Specified by:
getPassword
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- the password
- See Also:
UserDetails.getPassword()
-
getPasswordSalt
public String getPasswordSalt()
Return the password salt if defined.- Returns:
- the password salt
- See Also:
AccountSaltSource
-
getUsername
public String getUsername()
Return the user login name or principal.- Specified by:
getUsername
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- the user login name or principal
- See Also:
UserDetails.getUsername()
-
isAccountNonExpired
public boolean isAccountNonExpired()
Return whether the account has not yet expired (currently always returns true).- Specified by:
isAccountNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the account has not yet expired
- See Also:
UserDetails.isAccountNonExpired()
-
isAccountNonLocked
public boolean isAccountNonLocked()
Return whether the account has not been locked.- Specified by:
isAccountNonLocked
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the account has not been locked
- See Also:
UserDetails.isAccountNonLocked()
-
isCredentialsNonExpired
public boolean isCredentialsNonExpired()
Return whether the account credentials have not yet expired (currently always returns true)- Specified by:
isCredentialsNonExpired
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the account credentials have not yet expired
- See Also:
UserDetails.isCredentialsNonExpired()
-
isEnabled
public boolean isEnabled()
Return whether the account is enabled.- Specified by:
isEnabled
in interfaceorg.springframework.security.core.userdetails.UserDetails
- Returns:
- true if the SmartForm Manager account is active
- See Also:
UserDetails.isEnabled()
-
getUserAccount
public UserAccount getUserAccount()
Return the underlying user account.- Returns:
- the underlying user account
-
-