classes.org.grails.plugins.springsecurity.service
Class AuthenticateService

Authentication utility methods.

author:
T.Yamamoto
author:
Burt Beckwith

Field Summary
 def objectDefinitionSource
           
 def passwordEncoder
           
 def securityConfig
           
 boolean transactional
           
 
Constructor Summary
AuthenticateService()
           
 
Method Summary
void clearCachedRequestmaps()
           Call when editing, creating, or deleting a Requestmap to flush the cached configuration and rebuild using the most recent data.
void deleteRole(def role)
           Delete a role, and if Requestmap class is used to store roles, remove the role from all Requestmap definitions.
String encodePassword(String passwd)
          
List findRequestmapsByRole(String roleName, def domainClass, def conf)
          
ConfigObject getSecurityConfig()
           Load the security configuration.
boolean ifAllGranted(def role)
           dependency injection for the password encoder
boolean ifAnyGranted(def role)
          
boolean ifNotGranted(def role)
          
boolean isAjax(def request)
           Check if the request was triggered by an Ajax call.
boolean isLoggedIn()
          
String passwordEncoder(String passwd)
           returns a MessageDigest password.
def principal()
           Get the currently logged in user's principal.
boolean updateRole(def role, def newProperties)
           Update a role, and if Requestmap class is used to store roles, replace the new role name in all Requestmap definitions that use it if the name was changed.
def userDomain()
           Get the currently logged in user's domain class.
 

Constructor Detail

AuthenticateService

AuthenticateService()


Method Detail

clearCachedRequestmaps

void clearCachedRequestmaps()
Call when editing, creating, or deleting a Requestmap to flush the cached configuration and rebuild using the most recent data.


deleteRole

void deleteRole(def role)
Delete a role, and if Requestmap class is used to store roles, remove the role from all Requestmap definitions. If a Requestmap's config attribute is this role, it will be deleted.
param:
role the role to delete


encodePassword

String encodePassword(String passwd)


findRequestmapsByRole

List findRequestmapsByRole(String roleName, def domainClass, def conf)


getSecurityConfig

ConfigObject getSecurityConfig()
Load the security configuration.
return:
the config


ifAllGranted

boolean ifAllGranted(def role)
dependency injection for the password encoder


ifAnyGranted

boolean ifAnyGranted(def role)
deprecated:
You can invoke tags from controllers (since grails-0.6)


ifNotGranted

boolean ifNotGranted(def role)
deprecated:
You can invoke tags from controllers (since grails-0.6)


isAjax

boolean isAjax(def request)
Check if the request was triggered by an Ajax call.
param:
request the request
return:
true if Ajax


isLoggedIn

boolean isLoggedIn()


passwordEncoder

String passwordEncoder(String passwd)
returns a MessageDigest password. (changes algorithm method dynamically by param of config)
deprecated:
use encodePassword instead


principal

public def principal()
Get the currently logged in user's principal.
return:
the principal or null if not logged in


updateRole

boolean updateRole(def role, def newProperties)
Update a role, and if Requestmap class is used to store roles, replace the new role name in all Requestmap definitions that use it if the name was changed.
param:
role the role to update
param:
newProperties the new role attributes ('params' from the calling controller)


userDomain

public def userDomain()
Get the currently logged in user's domain class.
return:
the domain object or null if not logged in