Hi Rory,
Rory Douglas schrieb:
Hi Felix,
Thanks for this advice, I have it working now. I copied the mechanism
from SlingAuthenticator (for tracking AuthenticationHandler services)
almost verbatim. The facade checks the path property of each
DelegateAccessManager against the item path, and uses the appropriate
AM(s), or falls back to the default logic if there's no match.
Cool !
The complication was the dependency on org.apache.jackrabbit.core/spi
classes (for AccessManager, HierarchyManager etc). They aren't exported
anywhere, so I tried embedding them (like the jackrabbit-server
bundle). This enabled the bundle to load, but caused linkage errors
when Jackrabbit tried to instantiate my AccessManager, since
org.apache.jackrabbit.core.security.AccessManager was being loaded in 2
places. The quick solution I found was to modify the jackrabbit-server
pom.xml to export o.a.j.core and o.a.j.spi packages, though I'd be
interested in finding out if there's another way.
Unfortunately the "SPI" interfaces of jackrabbit core is not currently
properly separated from the actual implementations. So simply exporting
packages from the jackrabbit-core library is a pain and causes all sorts
of bundle resolution issues. That's why we did not export anything from
the jackrabbit-core for now.
If the export works for you, that is fine
I also implemented a basic ACL-based AccessManager bundle to test it
out. Let me know if you think these would be useful as samples.
I think almost everything, that extends and enhances Sling and/or
Jackrabbit is usefull as a sample in one sense or the other.
I am not sure, whether we can apply your changes to the export list of
the jackrabbit-server (I would have to inspect first ;-) ) but IMHO a
sample bundle with instructions on how to get it running would also be
worth something.
Thanks and Regards
Felix