The JCR API does not work when we are trying to modify/create rep:policy nodes.
I tried to have a look at the CqActionsServlet and CQActions class but could not make much progress on understanding the implementation.
Is there any API documentation on how to do this.
Basically the idea is to have a package of permission nodes (rep:policy) in the svn. As part of build process, we want to read the rep_policy.xmls and configure the corresponding permissions in CQ using RMI.
Could you explain what you mean by the JCR API? While JCR 1.0 didn't have any API for managing access control policies, JCR 2.0 does.
I don't know think AccessControlManager works over RMI. The JIRA issue is still open: https://issues.apache.org/jira/browse/JCR-2113
There is a Sling bundle which you can install to manage ACLs via HTTP: http://sling.apache.org/site/managing-permissions-jackrabbitaccessmanager.html. Search this forum for prior discussions.
For the use case you describe, you should be able to do that with content packages.