2 Replies Latest reply on Jul 6, 2010 4:00 AM by sflanigan

    Avoiding stack overflow in PersistentPermissionResolver

    sflanigan

      In our application, we've got a RuleBasedPermissionResolver (security.drl), but if none of the rules happens to grant a permission on a given check, it falls back on the PersistentPermissionResolver and ends up in infinite recursion (detectable in a debugger) - http://pastebin.org/369542
      and a (spurious?) NoClassDefFoundError: org/hibernate/hql/QueryExecutionRequestException (if you just look in the log) - http://pastebin.org/369538


      This problem sounds quite similar: http://seamframework.org/Community/StackOverflowProblemWhileUsingRestrictInConjuctionWithPreUpdateAndAPersistentPermissionResolver


      How can I stop the flush/permission check/flush cycle?


      Here's a bad attention-seeking idea: how about I override Identity.hasPermission(..) to return true when called recursively?