org.codehaus.groovy.grails.plugins.springsecurity
Class GrailsUserImpl

java.lang.Object
  extended by org.springframework.security.userdetails.User
      extended by org.codehaus.groovy.grails.plugins.springsecurity.GrailsUserImpl
All Implemented Interfaces:
Serializable, GrailsUser, org.springframework.security.userdetails.UserDetails
Direct Known Subclasses:
GrailsLdapUser

public class GrailsUserImpl
extends org.springframework.security.userdetails.User
implements GrailsUser

Extends Spring Security's User class to set Grails Domain Class at login, to load auth class from context.

Author:
T.Yamamoto, Burt Beckwith
See Also:
Serialized Form

Constructor Summary
GrailsUserImpl(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, org.springframework.security.GrantedAuthority[] authorities, Object user)
          Constructor.
 
Method Summary
 Object getDomainClass()
          Get the domain object representing the user.
 
Methods inherited from class org.springframework.security.userdetails.User
equals, getAuthorities, getPassword, getUsername, hashCode, isAccountNonExpired, isAccountNonLocked, isCredentialsNonExpired, isEnabled, setAuthorities, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.springframework.security.userdetails.UserDetails
getAuthorities, getPassword, getUsername, isAccountNonExpired, isAccountNonLocked, isCredentialsNonExpired, isEnabled
 

Constructor Detail

GrailsUserImpl

public GrailsUserImpl(String username,
                      String password,
                      boolean enabled,
                      boolean accountNonExpired,
                      boolean credentialsNonExpired,
                      boolean accountNonLocked,
                      org.springframework.security.GrantedAuthority[] authorities,
                      Object user)
               throws IllegalArgumentException
Constructor.

Parameters:
username - the username presented to the DaoAuthenticationProvider
password - the password that should be presented to the DaoAuthenticationProvider
enabled - set to true if the user is enabled
accountNonExpired - set to true if the account has not expired
credentialsNonExpired - set to true if the credentials have not expired
accountNonLocked - set to true if the account is not locked
authorities - the authorities that should be granted to the caller if they presented the correct username and password and the user is enabled
user - the user domain instance
Throws:
IllegalArgumentException - if a null value was passed either as a parameter or as an element in the GrantedAuthority[] array
Method Detail

getDomainClass

public Object getDomainClass()
Get the domain object representing the user.

Specified by:
getDomainClass in interface GrailsUser
Returns:
the user
See Also:
GrailsUser.getDomainClass()