-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User update removes all user roles #89
Comments
This PR should fix the ROLE problem, not the general saving problem however (mentioned in "EDIT"). For 3.1.2 (the not released version, master as of 12.02): |
ddelponte
added a commit
that referenced
this issue
Jul 19, 2018
- Added `webdrivermanager` dependency which will automatically download the chrome driver if it doesn't exist on the test machine - Modified simple integration `UserSpec` test to verify the fix for Issue #89
This was referenced Aug 12, 2018
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When updating a user, it removes all role associations, unless the user has none, than it does work.
Meaning you always have to update the user twice (re-selecting all roles).
I noticed that behaviour for versions:
3.1.0
3.1.1
I believe this is due to grails 3.3 taking hibernate a little different.
Currently this plugin simply deletes all UserRole and recreates the new ones.
However, as the whole function is inside a @transactional statement, this does not work as planned.
Even when setting flush to true, it only creates the diff of roles.
This means, even though having deleted (and flushed), the old userRoles are still recognized on "create" and are not beeing re-created.
I have played around a little bit and found only one working solution:
Do not delete all, check what to delete and what to create
I don't know if this is the "clean" way to do it, however I will make a PR with this change, and you can decide.
If it's not ok, please implement a different fix, because as of now, this is a major problem for us.
You want to change the user password -> roles get deleted.
EDIT:
I have also noticed, that with the current master, it is not possible to update users at all.
Setup:
Groovy 2.4.11
Java 1.8.0_161
grails 3.3.0
gradle 3.5
gorm 6.1.6.RELEASE
BR,
Alex
The text was updated successfully, but these errors were encountered: