[ 
https://issues.apache.org/jira/browse/SLING-9871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17304778#comment-17304778
 ] 

Bertrand Delacretaz commented on SLING-9871:
--------------------------------------------

I think we are mixing two concerns here:

C1) The order in which repoinit fragments provided in feature models are 
processed (by the Sling Feature Launcher?) is hard to control

C2) The ordering in of ACL entries set by multiple executions of the 
{{SlingRepositoryInitializer}} that executes repoinit statements is impossible 
to control

My understanding is that C1) is the only immediate concern in the scope of this 
ticket. [~ashishc] can you confirm?

C2 can happen in different situations and as discussed above fixing it is 
complicated, and IMHO out of scope of this ticket.

As mentioned above I think C1 _is not a repoinit concern_, it's a problem of 
the component (Sling Feature Launcher?) that aggregates repoinit fragments. So 
there's no need to fix it at the repoinit level.

But maybe repoinit can help aggregate fragments in the correct order, for 
example by naming fragments and declaring their dependencies, like for example:

{code}
  FRAGMENT NAME this one
  FRAGMENT DEPENDS ON the other one, fragment 12, another fragment
{code}

That information can be used by whatever aggregates the fragments to put them 
in the right order for execution. The repoinit parser can be strict about the 
above format (all on one line etc) so the aggregator can parse that info in a 
simple way, if needed.

But this would apply to the whole repoinit fragment, which is IMO easier to 
reason about that individual ACL statements.





> Specifying order of ACEs through repoinit directives
> ----------------------------------------------------
>
>                 Key: SLING-9871
>                 URL: https://issues.apache.org/jira/browse/SLING-9871
>             Project: Sling
>          Issue Type: Improvement
>          Components: Repoinit
>            Reporter: Ashish Chopra
>            Priority: Major
>
> As of writing this, repoinit processor (among other things not relevant to 
> this JIRA) collects {{create path}} statements and {{set ACL}} statements 
> declared in all the feature-models applicable to feature-aggregate under 
> consideration.
> Upon repository initialization, it applies all the {{create path}} 
> statements, followed by all the {{set ACL}} statements. However, the order in 
> which {{set ACL}} statements declared across feature models are applied isn't 
> defined (currently, it seems to be based on feature-model-name, 
> alphabetically ascending).
> This causes issues at times because we want the order of the ACEs to be 
> maintained (e.g., "deny"s for everyone at a given path must be the first ACE, 
> followed by "allow"s for specific, non-system-user principals)
> Repoinit should be able to support this requirement.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to