Use allow/block/deny methods to improve test readability
The readability of permission based tests is improved by introducing
the utility methods: allow, block, deny. Instead of:
grant(cfg, PUSH, REGISTERED_USERS, "refs/heads/*");
grant(cfg, FORGE_COMMITTER, ANONYMOUS_USERS, "refs/heads/*").setBlock(true);
grant(cfg, READ, REGISTERED_USERS, "refs/*").setDeny(true);
we now use:
allow(cfg, PUSH, REGISTERED_USERS, "refs/heads/*");
block(cfg, FORGE_COMMITTER, ANONYMOUS_USERS, "refs/heads/*");
deny(cfg, READ, REGISTERED_USERS, "refs/*");
Usage of "allow/block/deny" also resembles the corresponding drop-down
list from the permission editor UI.
Change-Id: I0de1a9f7014fc2ff48bebff1ecc894c8b80ad682
9 files changed