You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2022/03/01 14:57:13 UTC
[GitHub] [sling-org-apache-sling-jcr-repoinit] bdelacretaz commented on a change in pull request #22: SLING-11160 : Repoinit does not allow to remove individual ACEs (jcr impl)
bdelacretaz commented on a change in pull request #22:
URL: https://github.com/apache/sling-org-apache-sling-jcr-repoinit/pull/22#discussion_r816846413
##########
File path: src/test/java/org/apache/sling/jcr/repoinit/PrincipalBasedAclTest.java
##########
@@ -692,28 +693,64 @@ public void testRemoveMatchingEntry() throws Exception {
}
}
+ @Test
+ public void testRemoveNoExistingPolicy() throws Exception {
+ String setup = "remove principal ACL for " + U.username + "\n"
+ + "allow jcr:read on " + path + "\n"
+ + "end";
+ U.parseAndExecute(setup);
+ }
+
+ @Test
+ public void testRemoveMatchingEntry() throws Exception {
+ Principal principal = getPrincipal(U.username);
+ String setup = "set principal ACL for " + U.username + "\n"
+ + "allow jcr:write on "+path+"\n"
+ + "end";
+ U.parseAndExecute(setup);
+ assertPolicy(principal, U.adminSession, 1);
+
+ // privilege mismatch
+ setup = "remove principal ACL for " + U.username + "\n"
+ + "allow jcr:read,jcr:write on " + path + "\n"
+ + "end";
+ U.parseAndExecute(setup);
+ assertPolicy(principal, U.adminSession, 1);
+
+ // path mismatch
+ setup = "remove principal ACL for " + U.username + "\n"
+ + "allow jcr:write on " + path + "/mismatch\n"
+ + "end";
+ U.parseAndExecute(setup);
+ assertPolicy(principal, U.adminSession, 1);
+
+ // restriction mismatch
+ setup = "remove principal ACL for " + U.username + "\n"
+ + "allow jcr:write on " + path + " restriction(rep:glob, /*/jcr:content/*)\n"
+ + "end";
+ U.parseAndExecute(setup);
+ assertPolicy(principal, U.adminSession, 1);
+ }
+
@Test
public void testRemoveNoMatchingEntry() throws Exception {
+ Principal principal = getPrincipal(U.username);
String setup = "set principal ACL for " + U.username + "\n"
+ "allow jcr:write on "+path+"\n"
+ "end";
U.parseAndExecute(setup);
+ assertPolicy(principal, U.adminSession, 1);
- setup = "set principal ACL for " + U.username + "\n"
Review comment:
IIUC this test goes away with your changes, shouldn't it be kept? To test backwards compatibility - even if the corresponding operation is deprecated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org