I don't know those plugins, but assuming they're working in a similar
way to the vulnerability_tickets.py sample plugin, I tried to imagine a
way through. The perm and resource objects are both non-extensible
objects (their class is using the __slots__ mechanism), so you can't
attach a marker there to indicate that you're re-entering your
permission policy. So one way (apart from looking directly through the
call stack...) would be to create a Thread.local dictionary (or set) and
keep note there of the resources you've already started to check, so
that you can avoid recursion.
Of course, in future versions of the permission API, we could add a
mechanism for avoiding such issues, or at least make it easier for
permission policies to detect such situations.
-- Christian