src.groovy.org.codehaus.groovy.grails.plugins.springsecurity
Class GrailsDaoImpl

Copyright 2008 the original author or authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Field Summary
 def authenticateService
           
 String authoritiesMethodName
           
 String authorityFieldName
           
 String enabledFieldName
           
 Logger logger
           
 String loginUserDomainClass
           
 String passwordFieldName
           
 String relationalAuthoritiesField
           
 String usernameFieldName
           
 
Constructor Summary
GrailsDaoImpl()
           
 
Method Summary
void assertNotEmpty(Collection authorities, String username)
          
def createRolesByAuthoritiesMethod(def user, String username)
          
def createRolesByRelationalAuthorities(def user, String username)
          
UserDetails createUserDetails(String username, String password, boolean enabled, def authorities, Object user)
           Create the UserDetails instance.
Logger getLog()
          
def loadAuthorities(def user, String username, boolean loadRoles)
          
def loadDomainUser(def username, def session)
          
UserDetails loadUserByUsername(String username)
          
UserDetails loadUserByUsername(String username, boolean loadRoles)
           Load a user by username, optionally not loading roles.
 

Constructor Detail

GrailsDaoImpl

GrailsDaoImpl()


Method Detail

assertNotEmpty

void assertNotEmpty(Collection authorities, String username)


createRolesByAuthoritiesMethod

def createRolesByAuthoritiesMethod(def user, String username)


createRolesByRelationalAuthorities

def createRolesByRelationalAuthorities(def user, String username)


createUserDetails

UserDetails createUserDetails(String username, String password, boolean enabled, def authorities, Object user)
Create the UserDetails instance. Subclasses can override to inherit core functionality but determine the concrete class without reimplementing the entire class.
param:
username the username
param:
password the password
param:
enabled set to true if the user is enabled
param:
authorities the authorities that should be granted to the caller
param:
user the user domain instance
return:
the instance


getLog

Logger getLog()


loadAuthorities

def loadAuthorities(def user, String username, boolean loadRoles)


loadDomainUser

def loadDomainUser(def username, def session)


loadUserByUsername

UserDetails loadUserByUsername(String username)


loadUserByUsername

UserDetails loadUserByUsername(String username, boolean loadRoles)
Load a user by username, optionally not loading roles.
param:
username the login name
param:
loadRoles if true load roles from the database
return:
the user if found, otherwise throws UsernameNotFoundException
throws:
UsernameNotFoundException if the user isn't found
throws:
DataAccessException if there's a database problem