-
Notifications
You must be signed in to change notification settings - Fork 0
/
session_abcdefghijklmnop.P
40 lines (26 loc) · 1.07 KB
/
session_abcdefghijklmnop.P
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* Local Policy */
:-table says/2.
:-multifile says/2.
/* Sign rule */
says(P, Statement) :-
says(PK, Statement),
pk_belong(PK, P).
pk_belong(rsa_b2fcee5a72a0f5674d6537e870d71543, simon).
says(Group, Statement) :-
group_leader(Group, Leader),
says(Leader, Statement).
group_leader(group0, simon).
group_leader(group1, jeremiah).
/* Local access policy */
allow(PK, Access, Dir) :-
dir(Group, Dir),
says(Group, allow(PK, Access, Dir)).
dir(group0, file1).
dir(group0, file2).
dir(group1, file3).
/* Clauses for Context rsa_b2fcee5a72a0f5674d6537e870d71543 */
says(rsa_b2fcee5a72a0f5674d6537e870d71543,allow(PK,Access,Resources)):-says(rsa_b2fcee5a72a0f5674d6537e870d71543,pk_bind(P,PK)),says(rsa_b2fcee5a72a0f5674d6537e870d71543,allow(P,Access,Resources)).
says(rsa_b2fcee5a72a0f5674d6537e870d71543,pk_bind(jeremiah,rsa_3fcb4a57240d9287e43b8615e9994bba)).
says(rsa_b2fcee5a72a0f5674d6537e870d71543,allow(jeremiah,read,file1)).
says(rsa_b2fcee5a72a0f5674d6537e870d71543,allow(jeremiah,_anyAccess,file2)).
says(rsa_b2fcee5a72a0f5674d6537e870d71543,allow(jeremiah,read,file3)).