You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Cris Rockwell <cm...@umich.edu> on 2020/12/08 19:00:09 UTC

Repoinit ACL's only exist after Restart

After creating non-customized Sling12 Starter instance, the project Repoinit does not create ACL’s according to the configuration [1] without a restart. Directives for paths and user and groups are all created, but not the ACL’s. Is it known that a restart is needed for the ACL directives to take effect initially? Interesting, after restart ACL changes to the project repoinit config will take..

[1] https://github.com/headwirecom/peregrine-cms/blob/develop-sling12/platform/base/ui.apps/src/main/content/jcr_root/apps/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrine.config <https://github.com/headwirecom/peregrine-cms/blob/develop-sling12/platform/base/ui.apps/src/main/content/jcr_root/apps/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrine.config> 

Thoughts?

Cris 

Re: Repoinit ACL's only exist after Restart

Posted by Robert Munteanu <ro...@apache.org>.
On Tue, 2020-12-08 at 15:13 -0500, Cris Rockwell wrote:
> So, never mind the question below. There were ACL directives for
> paths that didn’t exist yet. Once these errors were cleared, ACL’s
> were set the first time as expected.

That problem would be solved by using principal-based ACLs. This is
already done for the Sling Starter, see [1] for an example how to
switch.

Thanks,
Robert

[1]:
https://github.com/apache/sling-org-apache-sling-starter/commit/5e8f7bb00afbab065c307bd68ee80fbedb00d76a


Re: Repoinit ACL's only exist after Restart

Posted by Cris Rockwell <cm...@umich.edu>.
So, never mind the question below. There were ACL directives for paths that didn’t exist yet. Once these errors were cleared, ACL’s were set the first time as expected.

08.12.2020 14:37:27.549 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=org.apache.sling.jcr.repoinit.RepositoryInitializer~peregrine)] org.apache.sling.jcr.oak.server.internal.OakSlingRepositoryManager Exception in a SlingRepositoryInitializer: RepositoryInitializerFactory, references=[], scripts=1
java.lang.RuntimeException: Failed to set ACL (javax.jcr.PathNotFoundException: Cannot set ACL on non-existent path /index.html) AclLine ALLOW {paths=[/index.html], privileges=[jcr:read]}
    at org.apache.sling.jcr.repoinit.impl.AclVisitor.setAcl(AclVisitor.java:64) [org.apache.sling.jcr.repoinit:1.1.26]
    at org.apache.sling.jcr.repoinit.impl.AclVisitor.visitSetAclPrincipal(AclVisitor.java:85) [org.apache.sling.jcr.repoinit:1.1.26]
    at org.apache.sling.repoinit.parser.operations.SetAclPrincipals.accept(SetAclPrincipals.java:53) [org.apache.sling.repoinit.parser:1.6.2]
    at org.apache.sling.jcr.repoinit.impl.JcrRepoInitOpsProcessorImpl.apply(JcrRepoInitOpsProcessorImpl.java:56) [org.apache.sling.jcr.repoinit:1.1.26]
    at org.apache.sling.jcr.repoinit.impl.RepositoryInitializerFactory.processRepository(RepositoryInitializerFactory.java:126) [org.apache.sling.jcr.repoinit:1.1.26]
    at org.apache.sling.jcr.base.AbstractSlingRepositoryManager$2.addingService(AbstractSlingRepositoryManager.java:473) [org.apache.sling.jcr.base:3.1.6]
    at org.apache.sling.jcr.base.AbstractSlingRepositoryManager$2.addingService(AbstractSlingRepositoryManager.java:462) [org.apache.sling.jcr.base:3.1.6]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:943)
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:871)
...
Caused by: javax.jcr.PathNotFoundException: Cannot set ACL on non-existent path /index.html
    at org.apache.sling.jcr.repoinit.impl.AclUtil.setAcl(AclUtil.java:120) [org.apache.sling.jcr.repoinit:1.1.26]
    at org.apache.sling.jcr.repoinit.impl.AclVisitor.setAcl(AclVisitor.java:62) [org.apache.sling.jcr.repoinit:1.1.26]
    ... 32 common frames omitted

Cris

> On Dec 8, 2020, at 2:00 PM, Cris Rockwell <cm...@umich.edu> wrote:
> 
> After creating non-customized Sling12 Starter instance, the project Repoinit does not create ACL’s according to the configuration [1] without a restart. Directives for paths and user and groups are all created, but not the ACL’s. Is it known that a restart is needed for the ACL directives to take effect initially? Interesting, after restart ACL changes to the project repoinit config will take..
> 
> [1] https://github.com/headwirecom/peregrine-cms/blob/develop-sling12/platform/base/ui.apps/src/main/content/jcr_root/apps/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrine.config <https://github.com/headwirecom/peregrine-cms/blob/develop-sling12/platform/base/ui.apps/src/main/content/jcr_root/apps/runmodes/config/org.apache.sling.jcr.repoinit.RepositoryInitializer-peregrine.config> 
> 
> Thoughts?
> 
> Cris