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 userStringgetPassword()Return the password.StringgetPasswordSalt()Return the password salt if defined.UserAccountgetUserAccount()Return the underlying user account.StringgetUsername()Return the user login name or principal.booleanisAccountNonExpired()Return whether the account has not yet expired (currently always returns true).booleanisAccountNonLocked()Return whether the account has not been locked.booleanisCredentialsNonExpired()Return whether the account credentials have not yet expired (currently always returns true)booleanisEnabled()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:
getAuthoritiesin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
- an array containing
GrantedAuthorityAdaptorobjects representing SmartForm Manager roles - See Also:
UserDetails.getAuthorities()
-
getPassword
public String getPassword()
Return the password.- Specified by:
getPasswordin 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:
getUsernamein 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:
isAccountNonExpiredin 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:
isAccountNonLockedin 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:
isCredentialsNonExpiredin 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:
isEnabledin 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
-
-