Permalink
Browse files

cleanup

  • Loading branch information...
1 parent 3fe642f commit 63d7649e11001d7f0df7fbe5f3f30be6fb541b0c @burtbeckwith burtbeckwith committed Dec 21, 2013
View
4 grails-app/conf/DefaultSecurityConfig.groovy
@@ -82,9 +82,9 @@ security {
authority {
className = null // must be set if using UserDetailsService
nameField = 'authority'
- groupAuthorityNameField = null //must be set if using authority groups
+ groupAuthorityNameField = null //must be set if using authority groups
}
- useRoleGroups = false
+ useRoleGroups = false
/** authenticationProcessingFilter */
apf {
View
14 grails-app/domain/test/TestRoleGroup.groovy
@@ -4,13 +4,13 @@ package test
* @author <a href='mailto:th3morg@gmail.com'>Ryan Morgan</a>
*/
class TestRoleGroup {
- String name
+ String name
- Set<TestRole> getRoles() {
- TestRoleGroupRoles.findAllByGroup(this).collect { it.role } as Set
- }
+ Set<TestRole> getRoles() {
+ TestRoleGroupRoles.findAllByGroup(this).collect { it.role }
+ }
- static constraints = {
- name blank: false, unique: true
- }
+ static constraints = {
+ name blank: false, unique: true
+ }
}
View
115 grails-app/domain/test/TestRoleGroupRoles.groovy
@@ -1,61 +1,64 @@
package test
+
/**
* @author <a href='mailto:th3morg@gmail.com'>Ryan Morgan</a>
*/
-class TestRoleGroupRoles implements Serializable{
- TestRoleGroup group
- TestRole role
-
- boolean equals(other) {
- if (!(other instanceof TestRoleGroupRoles)) {
- return false
- }
-
- other.role?.id == role?.id &&
- other.group?.id == group?.id
- }
-
- static TestRoleGroupRoles get(long roleId, long permissionId) {
- TestRoleGroupRoles.where {
- group == TestRoleGroup.load(roleId) &&
- role == TestRole.load(permissionId)
- }.get()
- }
-
- static TestRoleGroupRoles create(TestRoleGroup role, TestRole permission, boolean flush = false) {
- new TestRoleGroupRoles(group: role, role: permission).save(flush: flush, insert: true)
- }
-
- static boolean remove(TestRoleGroup r, TestRole p) {
- int rowCount = TestRoleGroupRoles.where {
- group == TestRoleGroup.load(r.id) && role == TestRole.load(p.id)
- }.deleteAll()
-
- rowCount > 0
- }
-
- static void removeAllByPermission(TestRole p) {
- TestRoleGroupRoles.where {
- role == TestRole.load(p.id)
- }.deleteAll()
- }
-
- static void removeAllByRole(TestRoleGroup r) {
- TestRoleGroupRoles.where {
- group == TestRoleGroup.load(r.id)
- }.deleteAll()
- }
-
- static constraints = {
- role validator: {permission, obj ->
- if(get(obj.group.id, permission.id)){
- return "rolePermission.exists"
- }
- }
- }
-
- static mapping = {
- autoTimestamp true
- id composite: ['group', 'role']
- }
+class TestRoleGroupRoles implements Serializable {
+
+ private static final long serialVersionUID = 1
+
+ TestRoleGroup group
+ TestRole role
+
+ boolean equals(other) {
+ if (!(other instanceof TestRoleGroupRoles)) {
+ return false
+ }
+
+ other.role?.id == role?.id && other.group?.id == group?.id
+ }
+
+ static TestRoleGroupRoles get(long roleId, long permissionId) {
+ TestRoleGroupRoles.where {
+ group == TestRoleGroup.load(roleId) &&
+ role == TestRole.load(permissionId)
+ }.get()
+ }
+
+ static TestRoleGroupRoles create(TestRoleGroup role, TestRole permission, boolean flush = false) {
+ new TestRoleGroupRoles(group: role, role: permission).save(flush: flush, insert: true)
+ }
+
+ static boolean remove(TestRoleGroup r, TestRole p) {
+ int rowCount = TestRoleGroupRoles.where {
+ group == TestRoleGroup.load(r.id) && role == TestRole.load(p.id)
+ }.deleteAll()
+
+ rowCount > 0
+ }
+
+ static void removeAllByPermission(TestRole p) {
+ TestRoleGroupRoles.where {
+ role == TestRole.load(p.id)
+ }.deleteAll()
+ }
+
+ static void removeAllByRole(TestRoleGroup r) {
+ TestRoleGroupRoles.where {
+ group == TestRoleGroup.load(r.id)
+ }.deleteAll()
+ }
+
+ static constraints = {
+ role validator: { r, obj ->
+ if (get(obj.group.id, r.id)) {
+ return "rolePermission.exists"
+ }
+ }
+ }
+
+ static mapping = {
+ id composite: ['group', 'role']
+ version false
+ }
}
View
2 grails-app/domain/test/TestUser.groovy
@@ -29,7 +29,7 @@ class TestUser {
boolean passwordExpired
Set<TestRole> getRoles() { TestUserRole.findAllByUser(this).collect { it.role } }
- Set<TestRoleGroup> getGroups() { TestUserRoleGroup.findAllByUser(this).collect { it.group } as Set}
+ Set<TestRoleGroup> getGroups() { TestUserRoleGroup.findAllByUser(this).collect { it.group } }
Collection<String> getRoleNames() { roles*.auth }
static constraints = {
View
101 grails-app/domain/test/TestUserRoleGroup.groovy
@@ -3,54 +3,55 @@ package test
/**
* @author <a href='mailto:th3morg@gmail.com'>Ryan Morgan</a>
*/
-class TestUserRoleGroup implements Serializable{
- TestUser user
- TestRoleGroup group
-
- boolean equals(other) {
- if (!(other instanceof TestUserRoleGroup)) {
- return false
- }
-
- other.user?.id == user?.id &&
- other.group?.id == group?.id
- }
-
- static TestUserRoleGroup get(long userId, long roleId) {
- TestUserRoleGroup.where {
- user == TestUser.load(userId) &&
- group == TestRoleGroup.load(roleId)
- }.get()
- }
-
- static TestUserRoleGroup create(TestUser user, TestRoleGroup role, boolean flush = false) {
- new TestUserRoleGroup(user: user, group: role).save(flush: flush, insert: true)
- }
-
- static boolean remove(TestUser u, TestRoleGroup r) {
-
- int rowCount = TestUserRoleGroup.where {
- user == TestUser.load(u.id) &&
- group == TestRoleGroup.load(r.id)
- }.deleteAll()
-
- rowCount > 0
- }
-
- static void removeAll(TestUser u) {
- TestUserRoleGroup.where {
- user == TestUser.load(u.id)
- }.deleteAll()
- }
-
- static void removeAll(TestRoleGroup r) {
- TestUserRoleGroup.where {
- group == TestRoleGroup.load(r.id)
- }.deleteAll()
- }
-
- static mapping = {
- id composite: ['group', 'user']
- }
-
+class TestUserRoleGroup implements Serializable {
+
+ private static final long serialVersionUID = 1
+
+ TestUser user
+ TestRoleGroup group
+
+ boolean equals(other) {
+ if (!(other instanceof TestUserRoleGroup)) {
+ return false
+ }
+
+ other.user?.id == user?.id && other.group?.id == group?.id
+ }
+
+ static TestUserRoleGroup get(long userId, long roleId) {
+ TestUserRoleGroup.where {
+ user == TestUser.load(userId) &&
+ group == TestRoleGroup.load(roleId)
+ }.get()
+ }
+
+ static TestUserRoleGroup create(TestUser user, TestRoleGroup role, boolean flush = false) {
+ new TestUserRoleGroup(user: user, group: role).save(flush: flush, insert: true)
+ }
+
+ static boolean remove(TestUser u, TestRoleGroup r) {
+ int rowCount = TestUserRoleGroup.where {
+ user == TestUser.load(u.id) &&
+ group == TestRoleGroup.load(r.id)
+ }.deleteAll()
+
+ rowCount > 0
+ }
+
+ static void removeAll(TestUser u) {
+ TestUserRoleGroup.where {
+ user == TestUser.load(u.id)
+ }.deleteAll()
+ }
+
+ static void removeAll(TestRoleGroup r) {
+ TestUserRoleGroup.where {
+ group == TestRoleGroup.load(r.id)
+ }.deleteAll()
+ }
+
+ static mapping = {
+ id composite: ['group', 'user']
+ version false
+ }
}
View
139 src/docs/guide/domainClasses/authorityGroupAuthorityClass.gdoc
@@ -9,72 +9,77 @@ import org.apache.commons.lang.builder.HashCodeBuilder
class GroupRole implements Serializable {
- private static final long serialVersionUID = 1
-
- Group group
- Role role
-
- boolean equals(other) {
- if (!(other instanceof GroupRole)) {
- return false
- }
-
- other.role?.id == role?.id &&
- other.group?.id == group?.id
- }
-
- int hashCode() {
- def builder = new HashCodeBuilder()
- if (group) builder.append(group.id)
- if (role) builder.append(role.id)
- builder.toHashCode()
- }
-
- static GroupRole get(long groupId, long roleId) {
- GroupRole.where {
- group == Group.load(groupId) &&
- role == Role.load(roleId)
- }.get()
- }
-
- static GroupRole create(Group group, Role role, boolean flush = false) {
- new GroupRole(group: group, role: role).save(flush: flush, insert: true)
- }
-
- static boolean remove(Group g, Role r) {
- int rowCount = GroupRole.where {
- group == Group.load(g.id) && role == Role.load(r.id)
- }.deleteAll()
-
- rowCount > 0
- }
-
- static void removeAllByRole(Role r) {
- GroupRole.where {
- role == Role.load(r.id)
- }.deleteAll()
- }
-
- static void removeAllByGroup(Group g) {
- GroupRole.where {
- group == Group.load(g.id)
- }.deleteAll()
- }
-
- static constraints = {
- role validator: { role, obj ->
- if (get(obj.group.id, role.id)) {
- return "rolePermission.exists"
- }
- }
- }
-
- static mapping = {
- autoTimestamp true
- id composite: ['group', 'role']
- }
+ private static final long serialVersionUID = 1
+
+ Group group
+ Role role
+
+ boolean equals(other) {
+ if (!(other instanceof GroupRole)) {
+ return false
+ }
+
+ other.role?.id == role?.id &&
+ other.group?.id == group?.id
+ }
+
+ int hashCode() {
+ def builder = new HashCodeBuilder()
+ if (group) builder.append(group.id)
+ if (role) builder.append(role.id)
+ builder.toHashCode()
+ }
+
+ static GroupRole get(long groupId, long roleId) {
+ GroupRole.where {
+ group == Group.load(groupId) &&
+ role == Role.load(roleId)
+ }.get()
+ }
+
+ static GroupRole create(Group group, Role role, boolean flush = false) {
+ new GroupRole(group: group, role: role).save(flush: flush, insert: true)
+ }
+
+ static boolean remove(Group g, Role r) {
+ int rowCount = GroupRole.where {
+ group == Group.load(g.id) && role == Role.load(r.id)
+ }.deleteAll()
+
+ rowCount > 0
+ }
+
+ static void removeAllByRole(Role r) {
+ GroupRole.where {
+ role == Role.load(r.id)
+ }.deleteAll()
+ }
+
+ static void removeAllByGroup(Group g) {
+ GroupRole.where {
+ group == Group.load(g.id)
+ }.deleteAll()
+ }
+
+ static constraints = {
+ role validator: { role, obj ->
+ if (get(obj.group.id, role.id)) {
+ return "rolePermission.exists"
+ }
+ }
+ }
+
+ static constraints = {
+ role validator: { r, obj ->
+ if (get(obj.group.id, r.id)) {
+ return 'rolePermission.exists'
+ }
+ }
+ }
+
+ static mapping = {
+ id composite: ['group', 'role']
+ version false
+ }
}
-
{code}
-
-
View
20 src/docs/guide/domainClasses/authorityGroupClass.gdoc
@@ -7,19 +7,19 @@ package com.mycompany.myapp
class Group {
- String name
+ String name
- static mapping = {
- cache true
- }
+ static mapping = {
+ cache true
+ }
- Set<Role> getAuthorities() {
- GroupRole.findAllByGroup(this).collect { it.role } as Set
- }
+ Set<Role> getAuthorities() {
+ GroupRole.findAllByGroup(this).collect { it.role } as Set
+ }
- static constraints = {
- name blank: false, unique: true
- }
+ static constraints = {
+ name blank: false, unique: true
+ }
}
{code}
View
114 src/docs/guide/domainClasses/personAuthorityGroupClass.gdoc
@@ -9,62 +9,62 @@ import org.apache.commons.lang.builder.HashCodeBuilder
class UserGroup implements Serializable {
- private static final long serialVersionUID = 1
-
- User user
- Group group
-
- boolean equals(other) {
- if (!(other instanceof UserGroup)) {
- return false
- }
-
- other.user?.id == user?.id &&
- other.group?.id == group?.id
- }
-
- int hashCode() {
- def builder = new HashCodeBuilder()
- if (user) builder.append(user.id)
- if (group) builder.append(group.id)
- builder.toHashCode()
- }
-
- static UserGroup get(long userId, long groupId) {
- UserGroup.where {
- user == User.load(userId) &&
- group == Group.load(groupId)
- }.get()
- }
-
- static UserGroup create(User user, Group group, boolean flush = false) {
- new UserGroup(user: user, group: group).save(flush: flush, insert: true)
- }
-
- static boolean remove(User u, Group g) {
- int rowCount = UserGroup.where {
- user == User.load(u.id) &&
- group == Group.load(g.id)
- }.deleteAll()
-
- rowCount > 0
- }
-
- static void removeAll(User u) {
- UserGroup.where {
- user == User.load(u.id)
- }.deleteAll()
- }
-
- static void removeAll(Group g) {
- UserGroup.where {
- group == Group.load(g.id)
- }.deleteAll()
- }
-
- static mapping = {
- id composite: ['group', 'user']
- version false
- }
+ private static final long serialVersionUID = 1
+
+ User user
+ Group group
+
+ boolean equals(other) {
+ if (!(other instanceof UserGroup)) {
+ return false
+ }
+
+ other.user?.id == user?.id &&
+ other.group?.id == group?.id
+ }
+
+ int hashCode() {
+ def builder = new HashCodeBuilder()
+ if (user) builder.append(user.id)
+ if (group) builder.append(group.id)
+ builder.toHashCode()
+ }
+
+ static UserGroup get(long userId, long groupId) {
+ UserGroup.where {
+ user == User.load(userId) &&
+ group == Group.load(groupId)
+ }.get()
+ }
+
+ static UserGroup create(User user, Group group, boolean flush = false) {
+ new UserGroup(user: user, group: group).save(flush: flush, insert: true)
+ }
+
+ static boolean remove(User u, Group g) {
+ int rowCount = UserGroup.where {
+ user == User.load(u.id) &&
+ group == Group.load(g.id)
+ }.deleteAll()
+
+ rowCount > 0
+ }
+
+ static void removeAll(User u) {
+ UserGroup.where {
+ user == User.load(u.id)
+ }.deleteAll()
+ }
+
+ static void removeAll(Group g) {
+ UserGroup.where {
+ group == Group.load(g.id)
+ }.deleteAll()
+ }
+
+ static mapping = {
+ id composite: ['group', 'user']
+ version false
+ }
}
{code}
View
6 src/groovy/grails/plugin/springsecurity/userdetails/GormUserDetailsService.groovy
@@ -100,10 +100,12 @@ class GormUserDetailsService implements GrailsUserDetailsService {
if (useGroups) {
if (authorityGroupPropertyName) {
authorities = userAuthorities.collect { it."$authorityGroupPropertyName" }.flatten().unique().collect { new SimpleGrantedAuthority(it."$authorityPropertyName") }
- } else {
+ }
+ else {
log.warn "Attempted to use group authorities, but the authority name field for the group class has not been defined."
}
- } else {
+ }
+ else {
authorities = userAuthorities.collect { new SimpleGrantedAuthority(it."$authorityPropertyName") }
}
authorities ?: [NO_ROLE]
View
6 src/templates/AuthorityGroup.groovy.template
@@ -8,9 +8,9 @@ class ${groupClassName} {
cache true
}
- Set<${roleClassName}> getAuthorities() {
- ${groupClassName}${roleClassName}.findAllBy${groupClassName}(this).collect { it.${roleClassProperty} } as Set
- }
+ Set<${roleClassName}> getAuthorities() {
+ ${groupClassName}${roleClassName}.findAllBy${groupClassName}(this).collect { it.${roleClassProperty} }
+ }
static constraints = {
name blank: false, unique: true
View
104 src/templates/AuthorityGroupAuthority.groovy.template
@@ -4,68 +4,68 @@ import org.apache.commons.lang.builder.HashCodeBuilder
class ${groupClassName}${roleClassName} implements Serializable{
- private static final long serialVersionUID = 1
+ private static final long serialVersionUID = 1
- ${groupClassName} ${groupClassProperty}
- ${roleClassName} ${roleClassProperty}
+ ${groupClassName} ${groupClassProperty}
+ ${roleClassName} ${roleClassProperty}
- boolean equals(other) {
- if (!(other instanceof ${groupClassName}${roleClassName})) {
- return false
- }
+ boolean equals(other) {
+ if (!(other instanceof ${groupClassName}${roleClassName})) {
+ return false
+ }
- other.${roleClassProperty}?.id == ${roleClassProperty}?.id &&
- other.${groupClassProperty}?.id == ${groupClassProperty}?.id
- }
+ other.${roleClassProperty}?.id == ${roleClassProperty}?.id &&
+ other.${groupClassProperty}?.id == ${groupClassProperty}?.id
+ }
- int hashCode() {
- def builder = new HashCodeBuilder()
- if (${groupClassProperty}) builder.append(${groupClassProperty}.id)
- if (${roleClassProperty}) builder.append(${roleClassProperty}.id)
- builder.toHashCode()
- }
+ int hashCode() {
+ def builder = new HashCodeBuilder()
+ if (${groupClassProperty}) builder.append(${groupClassProperty}.id)
+ if (${roleClassProperty}) builder.append(${roleClassProperty}.id)
+ builder.toHashCode()
+ }
- static ${groupClassName}${roleClassName} get(long ${groupClassProperty}Id, long ${roleClassProperty}Id) {
- ${groupClassName}${roleClassName}.where {
- ${groupClassProperty} == ${groupClassName}.load(${groupClassProperty}Id) &&
- ${roleClassProperty} == ${roleClassName}.load(${roleClassProperty}Id)
- }.get()
- }
+ static ${groupClassName}${roleClassName} get(long ${groupClassProperty}Id, long ${roleClassProperty}Id) {
+ ${groupClassName}${roleClassName}.where {
+ ${groupClassProperty} == ${groupClassName}.load(${groupClassProperty}Id) &&
+ ${roleClassProperty} == ${roleClassName}.load(${roleClassProperty}Id)
+ }.get()
+ }
- static ${groupClassName}${roleClassName} create(${groupClassName} role, ${roleClassName} ${roleClassProperty}, boolean flush = false) {
- new ${groupClassName}${roleClassName}(${groupClassProperty}: role, ${roleClassProperty}: ${roleClassProperty}).save(flush: flush, insert: true)
- }
+ static ${groupClassName}${roleClassName} create(${groupClassName} role, ${roleClassName} ${roleClassProperty}, boolean flush = false) {
+ new ${groupClassName}${roleClassName}(${groupClassProperty}: role, ${roleClassProperty}: ${roleClassProperty}).save(flush: flush, insert: true)
+ }
- static boolean remove(${groupClassName} g, ${roleClassName} r) {
- int rowCount = ${groupClassName}${roleClassName}.where {
- ${groupClassProperty} == ${groupClassName}.load(g.id) && ${roleClassProperty} == ${roleClassName}.load(r.id)
- }.deleteAll()
+ static boolean remove(${groupClassName} g, ${roleClassName} r) {
+ int rowCount = ${groupClassName}${roleClassName}.where {
+ ${groupClassProperty} == ${groupClassName}.load(g.id) && ${roleClassProperty} == ${roleClassName}.load(r.id)
+ }.deleteAll()
- rowCount > 0
- }
+ rowCount > 0
+ }
- static void removeAllBy${roleClassName}(${roleClassName} r) {
- ${groupClassName}${roleClassName}.where {
- ${roleClassProperty} == ${roleClassName}.load(r.id)
- }.deleteAll()
- }
+ static void removeAllBy${roleClassName}(${roleClassName} r) {
+ ${groupClassName}${roleClassName}.where {
+ ${roleClassProperty} == ${roleClassName}.load(r.id)
+ }.deleteAll()
+ }
- static void removeAllBy${groupClassName}(${groupClassName} g) {
- ${groupClassName}${roleClassName}.where {
- ${groupClassProperty} == ${groupClassName}.load(g.id)
- }.deleteAll()
- }
+ static void removeAllBy${groupClassName}(${groupClassName} g) {
+ ${groupClassName}${roleClassName}.where {
+ ${groupClassProperty} == ${groupClassName}.load(g.id)
+ }.deleteAll()
+ }
- static constraints = {
- ${roleClassProperty} validator: {${roleClassProperty}, obj ->
- if(get(obj.${groupClassProperty}.id, ${roleClassProperty}.id)){
- return "rolePermission.exists"
- }
- }
- }
+ static constraints = {
+ ${roleClassProperty} validator: { r, obj ->
+ if (get(obj.${groupClassProperty}.id, r.id)) {
+ return 'rolePermission.exists'
+ }
+ }
+ }
- static mapping = {
- autoTimestamp true
- id composite: ['${groupClassProperty}', '${roleClassProperty}']
- }
+ static mapping = {
+ id composite: ['${groupClassProperty}', '${roleClassProperty}']
+ version false
+ }
}
View
4 src/templates/Person.groovy.template
@@ -22,8 +22,8 @@ class ${userClassName} {
password column: '`password`'
}
- Set<<% out << (groupClassName ? groupClassName : roleClassName) %>> getAuthorities() {
- ${userClassName}<% out << groupClassName ? groupClassName : roleClassName %>.findAllBy${userClassName}(this).collect { it.<% out << (groupClassName ? groupClassProperty : roleClassProperty) %> } as Set
+ Set<<% out << (groupClassName ?: roleClassName) %>> getAuthorities() {
+ ${userClassName}<% out << groupClassName ?: roleClassName %>.findAllBy${userClassName}(this).collect { it.<% out << (groupClassProperty ?: roleClassProperty) %> }
}
def beforeInsert() {
View
28 test/integration/grails/plugin/springsecurity/GormUserDetailsServiceTests.groovy
@@ -36,12 +36,15 @@ class GormUserDetailsServiceTests extends GroovyTestCase {
private TestRole adminRole
private TestRole superAdminRole
+ private securityConfigGroupPropertyNames = ['useRoleGroups', 'authority.className', 'authority.nameField',
+ 'authority.groupAuthorityNameField', 'userLookup.authoritiesPropertyName']
+ private securityConfigGroupPropertyValues = securityConfigGroupPropertyNames.collectEntries { String name ->
+ [(name): ReflectionUtils.getConfigProperty(name)]
+ }
+
def sessionFactory
def userDetailsService
- def securityConfigGroupPropertyNames = ["useRoleGroups", "authority.className", "authority.nameField", "authority.groupAuthorityNameField", "userLookup.authoritiesPropertyName"]
- def securityConfigGroupPropertyValues = [:]
-
/**
* {@inheritDoc}
* @see junit.framework.TestCase#setUp()
@@ -50,9 +53,6 @@ class GormUserDetailsServiceTests extends GroovyTestCase {
protected void setUp() {
super.setUp()
org.codehaus.groovy.grails.commons.ConfigurationHolder.config = new ConfigObject()
- securityConfigGroupPropertyNames.each{
- securityConfigGroupPropertyValues.put(it, ReflectionUtils.getConfigProperty(it))
- }
assertEquals 0, TestRole.count()
adminRole = new TestRole(auth: ADMIN_ROLE_NAME, description: 'admin').save(failOnError: true)
superAdminRole = new TestRole(auth: SUPER_ADMIN_ROLE_NAME, description: 'super admin').save(failOnError: true)
@@ -67,9 +67,9 @@ class GormUserDetailsServiceTests extends GroovyTestCase {
protected void tearDown() {
super.tearDown()
org.codehaus.groovy.grails.commons.ConfigurationHolder.config = null
- securityConfigGroupPropertyValues.each {key, value ->
- ReflectionUtils.setConfigProperty(key, value)
- }
+ securityConfigGroupPropertyValues.each { key, value ->
+ ReflectionUtils.setConfigProperty key, value
+ }
}
void testLoadUserByUsername_NotFound() {
@@ -121,11 +121,11 @@ class GormUserDetailsServiceTests extends GroovyTestCase {
void testLoadUserByUsername_Groups() {
//Change the config to use authority groups
- ReflectionUtils.setConfigProperty("useRoleGroups", true)
- ReflectionUtils.setConfigProperty("authority.className", "test.TestRoleGroup")
- ReflectionUtils.setConfigProperty("authority.nameField", "auth")
- ReflectionUtils.setConfigProperty("authority.groupAuthorityNameField", "roles")
- ReflectionUtils.setConfigProperty("userLookup.authoritiesPropertyName", "groups")
+ ReflectionUtils.setConfigProperty 'useRoleGroups', true
+ ReflectionUtils.setConfigProperty 'authority.className', 'test.TestRoleGroup'
+ ReflectionUtils.setConfigProperty 'authority.nameField', 'auth'
+ ReflectionUtils.setConfigProperty 'authority.groupAuthorityNameField', 'roles'
+ ReflectionUtils.setConfigProperty 'userLookup.authoritiesPropertyName', 'groups'
String loginName = 'loginName'
String password = 'password123'

1 comment on commit 63d7649

@th3morg

Looks like my IDE wasn't playing nice with spacing; sorry about that.

Please sign in to comment.