Merge branch 'stable-2.9'
* stable-2.9: Link to solved issues from 2.9 release notes Reindex: Include exception cause when dying Fix the request wrapper for http requests served from plugins Fix a possibility to overcome BLOCK permission Add asciidoc build back in the Documentation folder Change CopyableLabel to hide onKeyUp Conflicts: gerrit-server/src/main/java/com/google/gerrit/server/project/PermissionCollection.java Change-Id: I1ebcc44873eb12acd80b4a0a98d22a73c69a886c
This commit is contained in:
@@ -299,6 +299,15 @@ public class RefControlTest {
|
||||
public void testBlockRule_ParentBlocksChild() {
|
||||
grant(local, PUSH, DEVS, "refs/tags/*");
|
||||
grant(util.getParentConfig(), PUSH, ANONYMOUS_USERS, "refs/tags/*").setBlock();
|
||||
ProjectControl u = util.user(local, DEVS);
|
||||
assertFalse("u can't update tag", u.controlForRef("refs/tags/V10").canUpdate());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBlockRule_ParentBlocksChildEvenIfAlreadyBlockedInChild() {
|
||||
grant(local, PUSH, DEVS, "refs/tags/*");
|
||||
grant(local, PUSH, ANONYMOUS_USERS, "refs/tags/*").setBlock();
|
||||
grant(util.getParentConfig(), PUSH, ANONYMOUS_USERS, "refs/tags/*").setBlock();
|
||||
|
||||
ProjectControl u = util.user(local, DEVS);
|
||||
assertFalse("u can't update tag", u.controlForRef("refs/tags/V10").canUpdate());
|
||||
@@ -318,6 +327,23 @@ public class RefControlTest {
|
||||
assertFalse("u can't vote 2", range.contains(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBlockLabelRange_ParentBlocksChildEvenIfAlreadyBlockedInChild() {
|
||||
grant(local, LABEL + "Code-Review", -2, +2, DEVS, "refs/heads/*");
|
||||
grant(local, LABEL + "Code-Review", -2, +2, DEVS, "refs/heads/*").setBlock();
|
||||
grant(util.getParentConfig(), LABEL + "Code-Review", -2, +2, DEVS,
|
||||
"refs/heads/*").setBlock();
|
||||
|
||||
ProjectControl u = util.user(local, DEVS);
|
||||
|
||||
PermissionRange range =
|
||||
u.controlForRef("refs/heads/master").getRange(LABEL + "Code-Review");
|
||||
assertTrue("u can vote -1", range.contains(-1));
|
||||
assertTrue("u can vote +1", range.contains(1));
|
||||
assertFalse("u can't vote -2", range.contains(-2));
|
||||
assertFalse("u can't vote 2", range.contains(2));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testUnblockNoForce() {
|
||||
grant(local, PUSH, ANONYMOUS_USERS, "refs/heads/*").setBlock();
|
||||
|
Reference in New Issue
Block a user