Search code examples
grailsspring-security

Grails 3.3.9 spring security 3.2.3 spring security ui 3.1.2 cannot change user data


Using Spring Security core 3.2.3 on Grails 3.3.9 I can add a user in BootStrap.groovy for example:

User u1 = new User(username: 'testuser1', password: 'finkaroney', email: '[email protected]')
Role sur = Role.findByAuthority('ROLE_USER')
u1.save(flush: true)
UserRole.create(u1, sur, true)

Also existing users can log in and out without problems.

Using Spring Security UI 3.1.2's interface, I can list users, roles, etc.

However with S2UI 3.1.2 I cannot:

  • add a user
  • delete a user
  • modify a user's parameters for example enabled, accountExpired and so forth

What generally happens when I try to do those things is a message pops up in the upper right of the browser window.

For example, if I try to delete a user I see this popup

Oops! That may not have been deleted. Either the form was submitted twice or possible CSRF attempt. Be careful what you click.

Or if I try to say expire the user I see this popup

testuser1 may not have been updated. Either the form was submitted twice or possible CSRF attempt. Be careful what you click.

Sure enough, in the first case the user is not deleted, and in the second, s/he is not expired.

There are no crashes nor any other related messages in the window where I'm running Grails.

This application has moved through several minor and major releases of Grails and Groovy so I would not be surprised if there is some cruft floating around somewhere. But I'm not sure where nor how to start looking for this kind of problem.


Solution

  • After a lot of checking and cursing and what not, I noticed just today that the Grails version reported in my gradle.properties was set to 3.3.3 and not 3.3.9. Upon correcting that, my UI now correctly changes and deletes users.