Skip to content

aclUtilService.addPermission does not write to database #15926

Description

@jasenj1

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().

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions