Add another two test cases to define ACL behavior

Change-Id: I620473c10aebb67e9354cc9c659961ab92b2ddd3
This commit is contained in:
Han-Wen Nienhuys
2018-02-08 15:54:28 +01:00
committed by hanwen
parent f8c86b2e8b
commit 0f8251004a

View File

@@ -670,6 +670,24 @@ public class RefControlTest {
assertCanUpdate("refs/heads/master", u);
}
@Test
public void unblockFromParentDoesNotAffectChild() {
allow(parent, PUSH, DEVS, "refs/heads/master", true);
block(local, PUSH, DEVS, "refs/heads/master");
ProjectControl u = user(local, DEVS);
assertCannotUpdate("refs/heads/master", u);
}
@Test
public void unblockFromParentDoesNotAffectChildDifferentGroups() {
allow(parent, PUSH, DEVS, "refs/heads/master", true);
block(local, PUSH, ANONYMOUS_USERS, "refs/heads/master");
ProjectControl u = user(local, DEVS);
assertCannotUpdate("refs/heads/master", u);
}
@Test
public void unblockMoreSpecificRefInLocalWithExclusiveFlag_Fails() {
block(parent, PUSH, ANONYMOUS_USERS, "refs/heads/*");