From c4f4ed6ee7f6fe49d19ca68b9fff6735b8a86fec Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 13 Apr 2010 16:30:46 -0400 Subject: Completely redid main Iflow logic; so far, policy and policy2 work --- tests/policy2.ur | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/policy2.ur (limited to 'tests/policy2.ur') diff --git a/tests/policy2.ur b/tests/policy2.ur new file mode 100644 index 00000000..b8480c0c --- /dev/null +++ b/tests/policy2.ur @@ -0,0 +1,22 @@ +type fruit = int +table fruit : { Id : fruit, Nam : string, Weight : float, Secret : string } + PRIMARY KEY Id, + CONSTRAINT Nam UNIQUE Nam + +(* Everyone may knows IDs and names. *) +policy sendClient (SELECT fruit.Id, fruit.Nam + FROM fruit) + +(* The weight is sensitive information; you must know the secret. *) +policy sendClient (SELECT fruit.Weight, fruit.Secret + FROM fruit + WHERE known(fruit.Secret)) + +fun main () = + x1 <- queryX (SELECT fruit.Id, fruit.Nam + FROM fruit + WHERE fruit.Nam = "apple") + (fn x =>
  • {[x.Fruit.Id]}: {[x.Fruit.Nam]}
  • ); + return + + -- cgit v1.2.3