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

Bertrand Delacretaz commented on SLING-7227:
--------------------------------------------

Thanks [~karlpauls], looks good!

For the syntax I think "register abstract privilege" would be more consistent 
with the existing syntax, compared to "create service user" for example. 
Instead of the "as abstract" suffix and with "abstract" being optional of 
course. 

FWIW there's a full syntax example at 
https://sling.apache.org/documentation/bundles/repository-initialization.html , 
for comparison with other statements.

If you agree, that's just a small parser change. Apart from that I think you're 
good to go, thanks!

In general we should add tests to {{ParsingErrorsTest}} [1] when introducing 
new syntax. If you think of interesting error cases please add them, but given 
that this new syntax is simple and flexible there might not be any. Just 
mentioning this in case someone looks at this ticket as an example later.

[1] 
https://github.com/apache/sling-org-apache-sling-repoinit-parser/blob/master/src/test/java/org/apache/sling/repoinit/parser/test/ParsingErrorsTest.java



> Repo Init: Add ability to register custom privileges
> ----------------------------------------------------
>
>                 Key: SLING-7227
>                 URL: https://issues.apache.org/jira/browse/SLING-7227
>             Project: Sling
>          Issue Type: Improvement
>          Components: Repoinit
>            Reporter: angela
>            Assignee: Karl Pauls
>            Priority: Major
>             Fix For: Repoinit Parser 1.2.2, Repoinit JCR 1.1.8
>
>
> [~marett], [~bdelacretaz], looking at the repo-init source I couldn't find a 
> way to register a custom privilege during repo init. I am sure this is an 
> oversight and hasn't been omitted intentionally.
> The corresponding API calls are:
> {code}
> JackrabbitWorkspace.getPrivilegeManager()
> PrivilegeManager.registerPrivilege(String privilegeName, boolean isAbstract, 
> String[] declaredAggregateNames)
> {code}
> See also
> http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/JackrabbitWorkspace.java?view=markup
> http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-api/src/main/java/org/apache/jackrabbit/api/security/authorization/PrivilegeManager.java?view=markup
> I would be appreciate if the repo init could have this gap filled. Thanks.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to