0

how can I upgrade an existing grails application with a request map? I didn't use

grails s2-quickstart package user role requestmap

but only

grails s2-quickstart package user role

AFAIK I have to 1) set a line in Config.groovy:

grails.plugins.springsecurity.securityConfigType = "Requestmap"

and then 2) set all the entries via BootStrap.groovy (according to spring's docs ), I get that, but how does the RequestMap Domain Class have to look like? Anything else to do? Thanks

4

1 回答 1

2

It's a simple class; this is what would be generated if you specify package your.package.name and class name Requestmap:

package your.package.name

class Requestmap {

   String url
   String configAttribute

   static mapping = {
      cache true
   }

   static constraints = {
      url blank: false, unique: true
      configAttribute blank: false
   }
}

Once you create this, add this line in Config.groovy:

grails.plugin.springsecurity.requestMap.className = 'your.package.name.Requestmap'
于 2013-03-30T00:53:38.973 回答