1 | # |
---|
2 | # This setup is used to test partial proof part of libabac |
---|
3 | # |
---|
4 | # This example shows a very simple delegation of roles by Acme and Osh. |
---|
5 | # Acme's buy_rockets role includes all of Acme's preferred customers, |
---|
6 | # Acme's buy_flowers role includes all of Acme's green thumbed customers, |
---|
7 | # Acme's buy_lumbers role is limited to those who is Acme's contractor, |
---|
8 | # and Osh's buy_rockets role includes all of Osh's preferred customers. |
---|
9 | # The setup.py creates the principals and the attr.py creates policy |
---|
10 | # credentials. |
---|
11 | # |
---|
12 | # partial_proof_rt1 |
---|
13 | # |
---|
14 | # partial proof checking sequence in libabac |
---|
15 | # can pLadybug buy_rockets from pAcme ? (fact) |
---|
16 | # can pLadybug What from pAcme ? (What) |
---|
17 | # Who can buy_rockets from pAcme ? (Who) |
---|
18 | # can pLadybug buy_rockets from Whom ? (whom) |
---|
19 | # can pLadybug What from Whom ? (What_Whom) |
---|
20 | |
---|
21 | |
---|
22 | #[keyid:Acme].role:buy_rockets <- [keyid:Acme].role:preferred_customer |
---|
23 | #[keyid:Acme].role:preferred_customer <- [keyid:Coyote] |
---|
24 | |
---|
25 | #[keyid:Acme].role:buy_flowers([keyid:Burpee]) <- [keyid:Acme].role:green_thumb |
---|
26 | #[keyid:Acme].role:green_thumb <- [keyid:Ladybug] |
---|
27 | #[keyid:Acme].role:green_thumb <- [keyid:Granny] |
---|
28 | |
---|
29 | #[keyid:Acme].role:buy_lumbers <- [keyid:Acme].role:contractor |
---|
30 | #[keyid:Acme].role:contractor <- [keyid:Granny] |
---|
31 | |
---|
32 | #[keyid:Osh].role:buy_rockets <- [keyid:Osh].role:preferred_customer |
---|
33 | #[keyid:Osh].role:preferred_customer <- [keyid:Ladybug] |
---|
34 | #[keyid:Osh].role:preferred_customer <- [keyid:Coyote] |
---|
35 | |
---|
36 | # trying quries with next_proof calls, |
---|
37 | # can coyote buy rockets from Acme ? |
---|
38 | # can ladybug buy rockets from Acme ? |
---|
39 | # can ladybug buy rockets from Osh ? |
---|
40 | # can ladybug buy lumbers from Acme ? |
---|
41 | # can pooh buy rockets from Osh ? |
---|
42 | # can pooh buy rockets from Osh ? (with next_proof calls) |
---|
43 | # can ladybug buy flowers from Acme ? |
---|
44 | # can pooh buy flowers from Acme ? |
---|
45 | |
---|