-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTools_second_half
More file actions
38 lines (29 loc) · 1018 Bytes
/
Tools_second_half
File metadata and controls
38 lines (29 loc) · 1018 Bytes
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
canRead(U, F) :- owner(F, U).
canRead(U, F) :- othersCanRead(F), principal(U).
canRead(U, F) :- owner(F, O), saysCanRead(O, U, F).
canRead(U, F) :- owner(F, O), delegatesTo(O, U).
canRead(U, F) :- owner(F, O), delegatesTo(O,P), saysCanRead(P, U, F).
canRead(U, F) :- owner(F, O), holds(U, R), saysCanRead(O, U, F).
file(file_one).
file(file_audit).
file(file_garbage).
file(file_private).
file(file_everyone_can_read).
principal(myself).
principal(someone).
principal(sibling).
owner(file_one, myself).
owner(file_audit, myself).
owner(file_garbage, myself).
owner(file_private, myself).
othersCanRead(file_everyone_can_read).
saysCanRead(myself, someone, file_private).
delegatesTo(myself, sibling).
saysCanRead(sibling, someone, file_garbage).
role(auditor).
role(manager).
holds(bob, manager).
holds(jake, auditor).
saysCanRead(myself, auditor, file_audit).
wget -O AbcDatalog-0.7.0.jar https://github.com/HarvardPL/AbcDatalog/releases/download/v0.7.0/AbcDatalog-0.7.0.jar
java -jar AbcDatalog-0.7.0.jar &