@Test public void testGrantSelectAndModifyOnData() { contract.verify(ImmutableSet.of(Permission.SELECT, Permission.MODIFY), DataResource.fromName("data/ks/table")); }
void verify(Set<Permission> operations, IResource suppliedResource) { if (!suppliedResource.applicablePermissions().containsAll(operations)) { throw new InvalidRequestException(String.format("Operation(s) %s are not applicable on %s", operations, suppliedResource)); } }
WhitelistContract { void verify(Set<Permission> operations, IResource suppliedResource) { if (!suppliedResource.applicablePermissions().containsAll(operations)) { throw new InvalidRequestException(String.format("Operation(s) %s are not applicable on %s", operations, suppliedResource)); } } }
WhitelistContract { void verify(Set<Permission> operations, IResource suppliedResource) { if (!suppliedResource.applicablePermissions().containsAll(operations)) { throw new InvalidRequestException(String.format("Operation(s) %s are not applicable on %s", operations, suppliedResource)); } }  }
WhitelistContract { void verify(Set<Permission> operations, IResource suppliedResource) { if (!suppliedResource.applicablePermissions().containsAll(operations)) { throw new InvalidRequestException(String.format("Operation(s) %s are not applicable on %s", operations, suppliedResource)); } }   }
WhitelistContract { void verify(Set<Permission> operations, IResource suppliedResource) { if (!suppliedResource.applicablePermissions().containsAll(operations)) { throw new InvalidRequestException(String.format("Operation(s) %s are not applicable on %s", operations, suppliedResource)); } }    }