Skip to content
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

aclUtilService.addPermission does not write to database #37

Open
jasenj1 opened this issue Aug 3, 2018 · 1 comment
Open

aclUtilService.addPermission does not write to database #37

jasenj1 opened this issue Aug 3, 2018 · 1 comment

Comments

@jasenj1
Copy link

jasenj1 commented Aug 3, 2018

I have an app with a bunch of existing domain objects/records I'm trying to add ACL to.

I created a method that grants permissions. Within the method is a catch block for NotFoundException which calls aclUtilService.addPermission().

From the best I trace out
acl.stacktrace.txt
, addPermission should call aclService.createAcl(oid) which should create the object identity and on down the stack to eventually .save()ing all the necessary objects.

But it doesn't.

When running my app with logSql turned on, I see a lot of selects, but no inserts. At the end of AclService.createAcl() (https://github.com/grails-plugins/grails-spring-security-acl/blob/master/plugin/grails-app/services/grails/plugin/springsecurity/acl/AclService.groovy#L84) is a call to readAclById(). This fails with a NotFoundException.

I see where the .save()s are done there is some error logging, but I don't see those log messages.

Is the Hibernate session not being flushed? Some other configuration switch I'm forgetting? FWIW, I'm using Oracle 12c as my database.

Attached is the SQL log & stack trace. The "About to create... " line is printed just before the call to aclUtilService.addPermission().

@jasenj1
Copy link
Author

jasenj1 commented Aug 3, 2018

FWIW, I subclassed AclService and created a method that does not do the final readAclById(). It works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant