Index: trunk/grails-app/controllers/AppCoreController.groovy
===================================================================
--- trunk/grails-app/controllers/AppCoreController.groovy	(revision 149)
+++ trunk/grails-app/controllers/AppCoreController.groovy	(revision 150)
@@ -55,5 +55,5 @@
             def personInstance = Person.get(authenticateService.userDomain().id)
             return [ personInstance : personInstance ]       
-        }  
+        }
 
         if (request.method == 'POST') {
Index: trunk/grails-app/controllers/AuthorityController.groovy
===================================================================
--- trunk/grails-app/controllers/AuthorityController.groovy	(revision 149)
+++ trunk/grails-app/controllers/AuthorityController.groovy	(revision 150)
@@ -3,117 +3,117 @@
 class AuthorityController extends BaseAppAdminController {
 
-	// the delete, save and update actions only accept POST requests
-	static Map allowedMethods = [delete: 'POST', save: 'POST', update: 'POST']
+    // the delete, save and update actions only accept POST requests
+    static Map allowedMethods = [delete: 'POST', save: 'POST', update: 'POST']
 
-	def authenticateService
+    def authenticateService
 
-	def index = {
-		redirect action: list, params: params
-	}
+    def index = {
+        redirect action: list, params: params
+    }
 
-	/**
-	 * Display the list authority page.
-	 */
-	def list = {
-		if (!params.max) {
-			params.max = 10
-		}
-		[authorityList: Authority.list(params)]
-	}
+    /**
+    * Display the list authority page.
+    */
+    def list = {
+        if (!params.max) {
+            params.max = 10
+        }
+        [authorityList: Authority.list(params)]
+    }
 
-	/**
-	 * Display the show authority page.
-	 */
-	def show = {
-		def authority = Authority.get(params.id)
-		if (!authority) {
-			flash.message = "Authority not found with id $params.id"
-			redirect action: list
-			return
-		}
+    /**
+    * Display the show authority page.
+    */
+    def show = {
+        def authority = Authority.get(params.id)
+        if (!authority) {
+            flash.message = "Authority not found with id $params.id"
+            redirect action: list
+            return
+        }
 
-		[authority: authority]
-	}
+        [authority: authority]
+    }
 
-	/**
-	 * Delete an authority.
-	 */
-	def delete = {
-		def authority = Authority.get(params.id)
-		if (!authority) {
-			flash.message = "Authority not found with id $params.id"
-			redirect action: list
-			return
-		}
+    /**
+    * Delete an authority.
+    */
+    def delete = {
+        def authority = Authority.get(params.id)
+        if (!authority) {
+            flash.message = "Authority not found with id $params.id"
+            redirect action: list
+            return
+        }
 
-		authenticateService.deleteRole(authority)
+        authenticateService.deleteRole(authority)
 
-		flash.message = "Authority $params.id deleted."
-		redirect action: list
-	}
+        flash.message = "Authority $params.id deleted."
+        redirect action: list
+    }
 
-	/**
-	 * Display the edit authority page.
-	 */
-	def edit = {
-		def authority = Authority.get(params.id)
-		if (!authority) {
-			flash.message = "Authority not found with id $params.id"
-			redirect action: list
-			return
-		}
+    /**
+    * Display the edit authority page.
+    */
+    def edit = {
+        def authority = Authority.get(params.id)
+        if (!authority) {
+            flash.message = "Authority not found with id $params.id"
+            redirect action: list
+            return
+        }
 
-		[authority: authority]
-	}
+        [authority: authority]
+    }
 
-	/**
-	 * Authority update action.
-	 */
-	def update = {
+    /**
+    * Authority update action.
+    */
+    def update = {
 
-		def authority = Authority.get(params.id)
-		if (!authority) {
-			flash.message = "Authority not found with id $params.id"
-			redirect action: edit, id: params.id
-			return
-		}
+        def authority = Authority.get(params.id)
+        if (!authority) {
+            flash.message = "Authority not found with id $params.id"
+            redirect action: edit, id: params.id
+            return
+        }
 
-		long version = params.version.toLong()
-		if (authority.version > version) {
-			authority.errors.rejectValue 'version', 'authority.optimistic.locking.failure',
-				'Another user has updated this Authority while you were editing.'
-			render view: 'edit', model: [authority: authority]
-			return
-		}
+        long version = params.version.toLong()
+        if (authority.version > version) {
+            authority.errors.rejectValue 'version', 'authority.optimistic.locking.failure',
+                'Another user has updated this Authority while you were editing.'
+            render view: 'edit', model: [authority: authority]
+            return
+        }
 
-		if (authenticateService.updateRole(authority, params)) {
-			authenticateService.clearCachedRequestmaps()
-			redirect action: show, id: authority.id
-		}
-		else {
-			render view: 'edit', model: [authority: authority]
-		}
-	}
+        if (authenticateService.updateRole(authority, params)) {
+            authenticateService.clearCachedRequestmaps()
+            redirect action: show, id: authority.id
+        }
+        else {
+            render view: 'edit', model: [authority: authority]
+        }
+    }
 
-	/**
-	 * Display the create new authority page.
-	 */
-	def create = {
-		[authority: new Authority()]
-	}
+    /**
+    * Display the create new authority page.
+    */
+    def create = {
+        [authority: new Authority()]
+    }
 
-	/**
-	 * Save a new authority.
-	 */
-	def save = {
+    /**
+    * Save a new authority.
+    */
+    def save = {
 
-		def authority = new Authority()
-		authority.properties = params
-		if (authority.save()) {
-			redirect action: show, id: authority.id
-		}
-		else {
-			render view: 'create', model: [authority: authority]
-		}
-	}
+        def authority = new Authority()
+        authority.properties = params
+        if (authority.save()) {
+            redirect action: show, id: authority.id
+        }
+        else {
+            render view: 'create', model: [authority: authority]
+        }
+    }
 }
Index: trunk/grails-app/controllers/PersonController.groovy
===================================================================
--- trunk/grails-app/controllers/PersonController.groovy	(revision 149)
+++ trunk/grails-app/controllers/PersonController.groovy	(revision 150)
@@ -7,10 +7,10 @@
     def filterService
 
-	// the delete, save and update actions only accept POST requests
-	static Map allowedMethods = [delete: 'POST', save: 'POST', update: 'POST']
+    // the delete, save and update actions only accept POST requests
+    static Map allowedMethods = [delete: 'POST', save: 'POST', update: 'POST']
 
-	def index = {
-		redirect action: list, params: params
-	}
+    def index = {
+        redirect action: list, params: params
+    }
 
     def list = {
@@ -27,5 +27,5 @@
     }
 
-	def show = {
+    def show = {
 
         // In the case of an actionSubmit button, rewrite action name from 'index'.
@@ -33,37 +33,37 @@
         { params.action='show' }
 
-		def person = Person.get(params.id)
-		if (!person) {
-			flash.message = "Person not found with id $params.id"
-			redirect action: list
-			return
-		}
-		List roleNames = []
-		for (role in person.authorities) {
-			roleNames << role.authority
-		}
-		roleNames.sort { n1, n2 ->
-			n1 <=> n2
-		}
-		[person: person, roleNames: roleNames]
-	}
+        def person = Person.get(params.id)
+        if (!person) {
+            flash.message = "Person not found with id $params.id"
+            redirect action: list
+            return
+        }
+        List roleNames = []
+        for (role in person.authorities) {
+            roleNames << role.authority
+        }
+        roleNames.sort { n1, n2 ->
+            n1 <=> n2
+        }
+        [person: person, roleNames: roleNames]
+    }
 
-	/**
-	 * Person delete action. Before removing an existing person,
-	 * they should be removed from those authorities which they are involved.
-	 */
-	def delete = {
+    /**
+    * Person delete action. Before removing an existing person,
+    * they should be removed from those authorities which they are involved.
+    */
+    def delete = {
 
-		def person = Person.get(params.id)
-		if (person) {
-			def authPrincipal = authenticateService.principal()
-			// Avoid self-delete.
-			if (!(authPrincipal instanceof String) && authPrincipal.username == person.loginName) {
-				flash.message = "You cannot delete yourself, please login as another manager and try again."
+        def person = Person.get(params.id)
+        if (person) {
+            def authPrincipal = authenticateService.principal()
+            // Avoid self-delete.
+            if (!(authPrincipal instanceof String) && authPrincipal.username == person.loginName) {
+                flash.message = "You cannot delete yourself, please login as another manager and try again."
                 redirect(action:show,id:params.id)
-			}
-			else {
-				//first, delete this person from Persons_Authorities table.
-				Authority.findAll().each { it.removeFromPersons(person) }
+            }
+            else {
+                //first, delete this person from Persons_Authorities table.
+                Authority.findAll().each { it.removeFromPersons(person) }
                 person.isActive = false
                 person.save(flush: true)
@@ -78,12 +78,12 @@
                     redirect(action:show,id:params.id)
                 }
-			}
-		}
-		else {
-			flash.message = "Person not found with id $params.id"
-		}
-	}
+            }
+        }
+        else {
+            flash.message = "Person not found with id $params.id"
+        }
+    }
 
-	def edit = {
+    def edit = {
 
         // In the case of an actionSubmit button, rewrite action name from 'index'.
@@ -91,35 +91,35 @@
         { params.action='edit' }
 
-		def person = Person.get(params.id)
-		if (!person) {
-			flash.message = "Person not found with id $params.id"
-			redirect action: list
-			return
-		}
-        flash.message = "To allow login at least the 'ROLE_AppUser' authority must be given."
-		return buildPersonModel(person)
-	}
+        def person = Person.get(params.id)
+        if (!person) {
+            flash.message = "Person not found with id $params.id"
+            redirect action: list
+            return
+        }
+        params.message = "To allow login at least the 'ROLE_AppUser' authority must be given."
+        return buildPersonModel(person)
+    }
 
-	/**
-	 * Person update action.
-	 */
-	def update = {
+    /**
+        * Person update action.
+        */
+    def update = {
 
-		def person = Person.get(params.id)
-		if (!person) {
-			flash.message = "Person not found with id $params.id"
-			redirect action: edit, id: params.id
-			return
-		}
+        def person = Person.get(params.id)
+        if (!person) {
+            flash.message = "Person not found with id $params.id"
+            redirect action: edit, id: params.id
+            return
+        }
 
-		long version = params.version.toLong()
-		if (person.version > version) {
-			person.errors.rejectValue 'version', "person.optimistic.locking.failure",
-				"Another user has updated this Person while you were editing."
+        long version = params.version.toLong()
+        if (person.version > version) {
+            person.errors.rejectValue 'version', "person.optimistic.locking.failure",
+                "Another user has updated this Person while you were editing."
             render view: 'edit', model: buildPersonModel(person)
-			return
-		}
+            return
+        }
 
-		person.properties = params
+        person.properties = params
 
         if(params.pass == "") {
@@ -142,52 +142,52 @@
         }
 
-	}
+    }
 
-	def create = {
-        flash.message = "To allow login at least the 'ROLE_AppUser' authority must be given."
-		[person: new Person(params), authorityList: Authority.list()]
-	}
+    def create = {
+        params.message = "To allow login at least the 'ROLE_AppUser' authority must be given."
+        [person: new Person(params), authorityList: Authority.list()]
+    }
 
-	/**
-	 * Person save action.
-	 */
-	def save = {
+    /**
+        * Person save action.
+        */
+    def save = {
 
-		def person = new Person()
-		person.properties = params
-		person.password = authenticateService.encodePassword(params.pass)
-		if (person.save()) {
-			addRoles(person)
-			redirect action: show, id: person.id
-		}
-		else {
-			render view: 'create', model: [authorityList: Authority.list(), person: person]
-		}
-	}
+        def person = new Person()
+        person.properties = params
+        person.password = authenticateService.encodePassword(params.pass)
+        if (person.save()) {
+            addRoles(person)
+            redirect action: show, id: person.id
+        }
+        else {
+            render view: 'create', model: [authorityList: Authority.list(), person: person]
+        }
+    }
 
-	private void addRoles(person) {
-		for (String key in params.keySet()) {
-			if (key.contains('ROLE') && 'on' == params.get(key)) {
-				Authority.findByAuthority(key).addToPersons(person)
-			}
-		}
-	}
+    private void addRoles(person) {
+        for (String key in params.keySet()) {
+            if (key.contains('ROLE') && 'on' == params.get(key)) {
+                Authority.findByAuthority(key).addToPersons(person)
+            }
+        }
+    }
 
-	private Map buildPersonModel(person) {
+    private Map buildPersonModel(person) {
 
-		List roles = Authority.list()
-		roles.sort { r1, r2 ->
-			r1.authority <=> r2.authority
-		}
-		Set userRoleNames = []
-		for (role in person.authorities) {
-			userRoleNames << role.authority
-		}
-		LinkedHashMap<Authority, Boolean> roleMap = [:]
-		for (role in roles) {
-			roleMap[(role)] = userRoleNames.contains(role.authority)
-		}
+        List roles = Authority.list()
+        roles.sort { r1, r2 ->
+            r1.authority <=> r2.authority
+        }
+        Set userRoleNames = []
+        for (role in person.authorities) {
+            userRoleNames << role.authority
+        }
+        LinkedHashMap<Authority, Boolean> roleMap = [:]
+        for (role in roles) {
+            roleMap[(role)] = userRoleNames.contains(role.authority)
+        }
 
-		return [person: person, roleMap: roleMap]
-	}
+        return [person: person, roleMap: roleMap]
+    }
 }
