(Quick Reference)

2 User Management - Reference Documentation

Authors: Burt Beckwith

Version: 1.0-RC3

2 User Management

User search

The default action for the User controller is search. By default only the standard fields (username, enabled, accountExpired, accountLocked, and passwordExpired) are available but this is customizable with the Scripts script - see the section on configuration for details.

You can search by any combination of fields, and the username field has an Ajax autocomplete to assist in finding instances. In this screenshot you can see that an email field has been added to the domain class and UI. Leave all fields empty and all checkboxes set at "Either" to return all instances.

This example shows a search for usernames containing 'adm' (the search is case-insensitive and the search string can appear anywhere in the username). Results are shown paginated in groups of 10. All of the column headers are clickable and will sort the results by that field.

User edit

After clicking through to the 'admin' User you get to the edit page (there are no view pages):

You can update any of the attributes or delete the User. You can see that there's a "Login as user" button here - that is only shown if you're authenticated with a User who is granted ROLE_SWITCH_USER (this role name can be configured in Config.groovy):

This allows you to temporarily assume the identity of another User (see the Spring Security Core plugin documentation for more information about switch-user). The "Logged in as ..." information in the top right of the screen will change to show that you're running as another User and provide a link to switch back. The role name ROLE_SWITCH_USER is the default but you can change the value with the grails.plugin.springsecurity.ui.switchUserRoleName setting in Config.groovy.

If you click the Roles tab you can see the roles granted to this User and can click through to its edit page:

User creation

You can create new Users by going to /user/create or by clicking the Create action in the Users menu.