On Feb 12, 2008, at 10:08 PM, Sailesh Ranjit wrote:
> Realized that it works if you put full set of attributes even if
> they are not
> in constraints, not sure what is the reason behind this is.
The nullable constraint defaults to false, although I don't think this
is
documented anywhere (
http://jira.codehaus.org/browse/GRAILS-2160)
> So, the user
> will save if we change User(...).save() as follows, the next thing I
> am
> trying to find out is how to save the authorities along with user,
> at the
> moment it does add the user but with no authority.
>
> import org.apache.commons.codec.digest.DigestUtils as DU
>
> class BootStrap {
>
> def init = { servletContext ->
>
> def md5pass = DU.md5Hex("pass")
>
> new
> User
> (username
> :"god",userRealName:"god",passwd:md5pass,enabled:true,email:"
email@...
> ",email_show:true,description:"Desc").save()
> new
> User
> (username
> :"admin",userRealName:"admin",passwd:md5pass,enabled:true,email:"
email@...
> ",email_show:true,description:"Desc").save()
>
> new
> Role
> (username
> :"god",description:"Superuser",authority:"ROLE_SUPERUSER").save()
> new
> Role
> (username
> :"admin
> ",description:"Administrator",authority:"ROLE_ADMINISTRATOR").save()
>
> new
> Requestmap(url:"/captcha/**",configAttribute:"ROLE_SUPERUSER").save()
> new
> Requestmap(url:"/register/
> **",configAttribute:"ROLE_ADMINISTRATOR").save()
>
> new Product(name:"XT-20",category:"Bike",type:"Fender
> Eliminators",description:"Fender Eliminators").save()
> new Product(name:"GT-30",category:"Car",type:"Numberplate
> Mount",description:"Numberplate Mount").save()
> new Product(name:"AT-90",category:"Rocket",type:"Square
> Steering
> Wheel",description:"Square Steering Wheel").save()
>
> }
> def destroy = {
> }
> }
> --
> View this message in context:
http://www.nabble.com/Bootstrap-issue-with-Acegi-tp15447982p15448450.html> Sent from the grails - user mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>
http://xircles.codehaus.org/manage_email>
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email