Prevent pushing of patch sets onto invisible patch sets
A previous bug would allow users to push a patch set onto a draft patch set they cannot see. This commit fixes the bug and adds some tests. Change-Id: I58a8353f67a47361f6dbd3bf776969130d90a529
This commit is contained in:
		| @@ -520,10 +520,16 @@ public abstract class AbstractDaemonTest { | ||||
|  | ||||
|   protected PushOneCommit.Result amendChange(String changeId, String ref) | ||||
|       throws Exception { | ||||
|     return amendChange(changeId, ref, admin, testRepo); | ||||
|   } | ||||
|  | ||||
|   protected PushOneCommit.Result amendChange(String changeId, String ref, | ||||
|       TestAccount testAccount, TestRepository<?> repo) throws Exception { | ||||
|     Collections.shuffle(RANDOM); | ||||
|     PushOneCommit push = | ||||
|         pushFactory.create(db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, | ||||
|             PushOneCommit.FILE_NAME, new String(Chars.toArray(RANDOM)), changeId); | ||||
|         pushFactory.create(db, testAccount.getIdent(), repo, | ||||
|             PushOneCommit.SUBJECT, PushOneCommit.FILE_NAME, | ||||
|             new String(Chars.toArray(RANDOM)), changeId); | ||||
|     return push.to(ref); | ||||
|   } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Patrick Hiesel
					Patrick Hiesel