@Test
public void testExplicitDeny() {
AccessController ctrl = new AccessController();
ctrl.setGroupLookup(NO_GROUPS);
ctrl.setUserPermissionsLookup(ALWAYS_DENY);
EntityDescriptor ed = new EntityDescriptor(EntityType.Operation, 1);
for (Permission p : Permission.values()) {
// The user admin should always have full access, regardless of what the DB says
assertTrue(ctrl.hasPermission(new User(0, "admin"), ed, p));
for (int n = 1; n < 10; ++n) {
assertFalse(ctrl.hasPermission(new User(n, "john.doe"), ed, p));