Skip to content

Commit 9f90f67

Browse files
bkoehmmatrei
authored andcommitted
docs: specify a domain class name when securityConfigType is Requestmap (#1179)
1 parent 08ddb18 commit 9f90f67

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

plugin-core/docs/src/docs/requestMappings/requestmapInstances.adoc

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,47 @@ To use `Requestmap` entries, specify `securityConfigType="Requestmap"`:
3030
grails.plugin.springsecurity.securityConfigType = "Requestmap"
3131
----
3232

33+
A domain class must also be specified for the `Requestmap`:
34+
35+
[source,groovy]
36+
.Listing {counter:listing}. Specifying `requestMap.className` with a domain class
37+
----
38+
grails.plugin.springsecurity.requestMap.className = "com.foo.bar.Requestmap"
39+
----
40+
41+
An example `Requestmap` domain class:
42+
[source, groovy]
43+
.`Requestmap.groovy`
44+
----
45+
package com.foo.bar
46+
47+
import org.springframework.http.HttpMethod
48+
49+
import groovy.transform.EqualsAndHashCode
50+
import groovy.transform.ToString
51+
52+
@EqualsAndHashCode(includes=['configAttribute', 'httpMethod', 'url'])
53+
@ToString(includes=['configAttribute', 'httpMethod', 'url'], cache=true, includeNames=true, includePackage=false)
54+
class Requestmap implements Serializable {
55+
56+
private static final long serialVersionUID = 1
57+
58+
String configAttribute
59+
HttpMethod httpMethod
60+
String url
61+
62+
static constraints = {
63+
configAttribute nullable: false, blank: false
64+
httpMethod nullable: true
65+
url nullable: false, blank: false, unique: 'httpMethod'
66+
}
67+
68+
static mapping = {
69+
cache true
70+
}
71+
}
72+
----
73+
3374
You create `Requestmap` entries as you create entries in any Grails domain class:
3475

3576
[source,groovy]

0 commit comments

Comments
 (0)