This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch master
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-repoinit-parser.git


The following commit(s) were added to refs/heads/master by this push:
     new 1567356  SLING-8619 - RepoInitGrammer: Add repository-level marker to 
pathsList
1567356 is described below

commit 156735694af01d379f4b2e4216fb2581ee93b80c
Author: Angela Schreiber <[email protected]>
AuthorDate: Thu Sep 19 17:06:29 2019 +0200

    SLING-8619 - RepoInitGrammer: Add repository-level marker to pathsList
---
 .../java/org/apache/sling/repoinit/parser/operations/AclLine.java    | 1 +
 .../org/apache/sling/repoinit/parser/operations/package-info.java    | 2 +-
 src/main/javacc/RepoInitGrammar.jjt                                  | 5 +++--
 src/test/resources/testcases/test-15-output.txt                      | 2 ++
 src/test/resources/testcases/test-15.txt                             | 4 ++++
 src/test/resources/testcases/test-32-output.txt                      | 2 ++
 src/test/resources/testcases/test-32.txt                             | 4 ++++
 7 files changed, 17 insertions(+), 3 deletions(-)

diff --git 
a/src/main/java/org/apache/sling/repoinit/parser/operations/AclLine.java 
b/src/main/java/org/apache/sling/repoinit/parser/operations/AclLine.java
index 0dd5baa..4e5222b 100644
--- a/src/main/java/org/apache/sling/repoinit/parser/operations/AclLine.java
+++ b/src/main/java/org/apache/sling/repoinit/parser/operations/AclLine.java
@@ -33,6 +33,7 @@ public class AclLine {
     public static final String PROP_PRINCIPALS = "principals";
     public static final String PROP_PRIVILEGES = "privileges";
     public static final String PROP_NODETYPES = "nodetypes";
+    public static final String PATH_REPOSITORY = ":repository";
 
     public enum Action {
         REMOVE, REMOVE_ALL, DENY, ALLOW
diff --git 
a/src/main/java/org/apache/sling/repoinit/parser/operations/package-info.java 
b/src/main/java/org/apache/sling/repoinit/parser/operations/package-info.java
index 84d9d11..0e1870e 100644
--- 
a/src/main/java/org/apache/sling/repoinit/parser/operations/package-info.java
+++ 
b/src/main/java/org/apache/sling/repoinit/parser/operations/package-info.java
@@ -15,6 +15,6 @@
  * limitations under the License.
  
******************************************************************************/
 
[email protected]("4.2.0")
[email protected]("4.3.0")
 package org.apache.sling.repoinit.parser.operations;
 
diff --git a/src/main/javacc/RepoInitGrammar.jjt 
b/src/main/javacc/RepoInitGrammar.jjt
index bc00916..3b5b83b 100644
--- a/src/main/javacc/RepoInitGrammar.jjt
+++ b/src/main/javacc/RepoInitGrammar.jjt
@@ -94,6 +94,7 @@ TOKEN:
 /* The order of these fuzzy statements is important (first match wins?) */ 
 |   < NAMESPACED_ITEM: (["a"-"z"] | ["A"-"Z"])+ ":" (["a"-"z"] | ["A"-"Z"])+ >
 |   < PATH_STRING: "/" (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | ["-"] | ["_"] | 
["."] | ["@"] | [":"] | ["+"] | ["/"]) * >
+|   < PATH_REPOSITORY: ":repository" >
 |   < STRING: (["a"-"z"] | ["A"-"Z"] | ["0"-"9"] | ["-"] | ["_"] | ["."] | 
["/"] | [":"] | ["*"]) + >
 |   < EOL: "\n" >
 }
@@ -217,8 +218,8 @@ List<String> pathsList() :
     List<String> paths = new ArrayList<String>();
 }
 {
-    t = <PATH_STRING> { paths.add(t.image); } 
-    ( <COMMA> t = <PATH_STRING> { paths.add(t.image); } )* 
+    ( t = <PATH_STRING> | t = <PATH_REPOSITORY> ) { paths.add(t.image); }
+    ( <COMMA> ( t = <PATH_STRING> | t = <PATH_REPOSITORY> ) { 
paths.add(t.image); } )*
     { return paths; }
 }
 
diff --git a/src/test/resources/testcases/test-15-output.txt 
b/src/test/resources/testcases/test-15-output.txt
new file mode 100644
index 0000000..b13efdc
--- /dev/null
+++ b/src/test/resources/testcases/test-15-output.txt
@@ -0,0 +1,2 @@
+SetAclPaths on /content :repository 
+  AclLine ALLOW {principals=[user1], privileges=[jcr:all]}
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-15.txt 
b/src/test/resources/testcases/test-15.txt
new file mode 100644
index 0000000..6095705
--- /dev/null
+++ b/src/test/resources/testcases/test-15.txt
@@ -0,0 +1,4 @@
+# including repo-level
+set ACL on /content,:repository
+    allow jcr:all for user1
+end
\ No newline at end of file
diff --git a/src/test/resources/testcases/test-32-output.txt 
b/src/test/resources/testcases/test-32-output.txt
new file mode 100644
index 0000000..4c48ea7
--- /dev/null
+++ b/src/test/resources/testcases/test-32-output.txt
@@ -0,0 +1,2 @@
+SetAclPrincipals for user1 
+  AclLine ALLOW {paths=[:repository, /content], privileges=[jcr:all]}
diff --git a/src/test/resources/testcases/test-32.txt 
b/src/test/resources/testcases/test-32.txt
new file mode 100644
index 0000000..367dea8
--- /dev/null
+++ b/src/test/resources/testcases/test-32.txt
@@ -0,0 +1,4 @@
+# including repo-level
+set ACL for user1
+    allow jcr:all on :repository,/content
+end
\ No newline at end of file

Reply via email to