Mercurial > urweb
diff tests/policy.ur @ 1214:648e6b087dfb
Change query_policy to sendClient; all arguments passed to SQL predicates are variables
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 08 Apr 2010 09:57:37 -0400 |
parents | c5bd970e77a5 |
children | 7dfa67560916 |
line wrap: on
line diff
--- a/tests/policy.ur Tue Apr 06 16:14:19 2010 -0400 +++ b/tests/policy.ur Thu Apr 08 09:57:37 2010 -0400 @@ -9,18 +9,18 @@ CONSTRAINT Fruit FOREIGN KEY Fruit REFERENCES fruit(Id) (* Everyone may knows IDs and names. *) -policy query_policy (SELECT fruit.Id, fruit.Nam - FROM fruit) +policy sendClient (SELECT fruit.Id, fruit.Nam + FROM fruit) (* The weight is sensitive information; you must know the secret. *) -policy query_policy (SELECT fruit.Weight, fruit.Secret - FROM fruit - WHERE known(fruit.Secret)) +policy sendClient (SELECT fruit.Weight, fruit.Secret + FROM fruit + WHERE known(fruit.Secret)) -policy query_policy (SELECT order.Id, order.Fruit, order.Qty - FROM order, fruit - WHERE order.Fruit = fruit.Id - AND order.Qty = 13) +policy sendClient (SELECT order.Id, order.Fruit, order.Qty + FROM order, fruit + WHERE order.Fruit = fruit.Id + AND order.Qty = 13) fun fname r = x <- queryX (SELECT fruit.Weight