Audit Trail
Dependency :
compile ":audit-trail:2.0.0"
Summary
Please use version 2.0.1,Version 2.0.0 has a big bug when use with spring-securite-ui
Description
See the docs here https://github.com/9ci/grails-audit-trail
https://github.com/9ci/grails-audit-trailThe Docs below are valid for versions 1.2 and earlier which will work with Grails < 1.3.6 For Grails version 1.3.6+ and 2.0.0+ please See the docs here https://github.com/9ci/grails-audit-trail the 2.0.0 version of this is compatible with Grails 1.3.7 and 2+ Stick with 1.2 for anything pre 1.3.6~~This plugin lets you add an annotation to your domain classes so they will get stamped after a new insert or update. It release under the same Apache V2 license as Grails. It will automatically add fields based on your settings in Config.groovy. Provides an AST transfomation annotation and hibernate events to take care of stamping for your gorm objects with the user who edited or created the record.Will also allow you to specify a default custom id mapping and generator so you don't have to add them to every class.
Overview
Currently works with Spring Security Core 1.0.1 and allows you to specify which domain object and what the fields will be called for stamping the id of a user who made a change or created the entityStep-by-Step
1) Install the plugin for your project (you should already have the acegi plugin)grails install-plugin audit-trail
@gorm.AuditStamp
class Note{
String note
static mapping = {}
static constraints = {}
}stamp{
audit{
//the created and edited fields should be present or they won't get added during AST
createdBy="createdBy" //id who created
createdDate="createdDate" // if you want a date stamp that is not the grails default dateCreated
editedBy="updatedBy" //id who updated/edited
editedDate="editedDate"//use this field instead of the grails default lastUpdate
}
}