3 Configuration - Reference Documentation
Authors: Sudhir Nimavat
Version: 0.5.2
Table of Contents
3 Configuration
Nimble configuration is devided into two files,DefaultNimbleConfig.groovy
which is packaged inside plugin and NimbleConfig.groovy
which resides into conf directory of host application.
Values in DefaultNimbleConfig.groovy
are all considered to be sensible defaults for most usage of Nimble, however all of these values an be overridden by simply redefining them in NimbleConfig.groovy
3.1 Configuring table names
It is possible to change the table names for domain classes provided by nimble.Currently the following Nimble domain classes have been setup to utilize configurable table names- User
- Profile
- Role
- Group
- Permission
- LevelPermission
- LoginRecord
- Url
DefaultNimbleConfig.groovy
is as below:
- user = "_user"
- role = "_role"
- group = "_group"
- profilebase = "profile_base"
- loginrecord = "login_record"
- permission = "permission"
- levelpermission = "level_permission"
- url = "url"
conf/NimbleConfig.groovy
as shown below:nimble { tablenames { user = "user_master" role = "role_master" group = "group_master" } }
3.2 User account configuration
You can configure things like whether to allow new user registration, username requirements, and whether new user account is enabled after successful registration as shown below.nimble{ localusers { usernames { minlength = 4 validregex = '[a-zA-Z0-9]*' //regex that should be used for validating username } provision { active = false } //whether new user accoutn should be enabled or disabled after registration registration { enabled = true } //Allow new users to register or now } }
3.3 Password requirements
Nimble has password requirements for new user registration. Default is as shown below:nimble{ passwords { mustcontain { lowercase = true uppercase = true numbers = true symbols = true } minlength = 8 } }
NimbleConfig.groovy
3.4 Email Settings
Nimble can be configured to send emails for registration, password reset and email address change. By default mails are disabled. It can be configured to enable mails, and subjects of mails.nimble { messaging { enabled = true registration { subject = "Your new account is ready!" } passwordreset { subject = "Your password has been reset" } changeemail { subject = "Your email address has been changed" } } }
Nimble depends on Grails for sending mails. You must configure mail plugin properly if you enable messaging in nimble.
3.5 UI Layout
Default layouts used by nimble views can be changed as shown below:nimble { layout { application = 'app' administration = 'admin' //layout used by nimble administration portal. } }