-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.pro
109 lines (71 loc) · 2.49 KB
/
debug.pro
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
% include
:- ensure_loaded("extended.pro").
:- ensure_loaded("consistency.pro").
% :- ensure_loaded("debug_advanced.pro").
:- init.
:- addUser(alice, []), initUserC(alice).
:- addUser(bob, [colludingProne]), initUserC(bob).
:- addUser(david, []), initUserC(david).
:- addRole(staff, []).
:- addRole(engineer, []).
:- assignUserToRole(alice, staff).
:- assignUserToRole(alice, engineer).
:- assignUserToRole(bob, staff).
:- assignUserToRole(bob, engineer).
:- assignUserToRole(david, staff).
:- addResource(admin, budget, [], 1).
:- addResource(admin, shuttle, [enc, cspNoEnforce], 1).
:- addResource(admin, temperature, [enc, eager], 1).
:- assignPermissionToRole(staff, [read], budget).
:- assignPermissionToRole(engineer, [read, write], shuttle).
:- assignPermissionToRole(engineer, [read], temperature).
:- halt.
% debug
% :- init,
% addUser(simone),
% initUserK(simone),
% addRole(staff),
% addResource(balance),
% assignUserToRole(simone, staff),
% assignPermissionToRole(staff, read, balance),
% assignPredicate(enc, balance),
% assertConflicts,
% revokePredicate(enc, balance),
% assertConflicts.
% :- init.
% :- init,
% addUser(simone),
% initUserK(simone),
% assignPredicate(colludingProne, simone),
% addUser(alessandro),
% initUserK(alessandro),
% addRole(staff),
% addRole(engineer),
% addResource(balance),
% assignPredicate(enc, balance),
% assignPredicate(cspNoEnforce, balance),
% addResource(shuttle),
% assignPredicate(enc, shuttle),
% assignUserToRole(simone, staff),
% assignUserToRole(alessandro, staff),
% assignUserToRole(simone, engineer),
% assignPermissionToRole(staff, readwrite, balance),
% assignPermissionToRole(staff, read, shuttle),
% assignPermissionToRole(engineer, write, shuttle).
% % :- format("initAdmK~n", []).
% % :- initAdmK.
% % :- format("addUser(simone)~n", []).
% % :- addUser(simone).
% % :- initUserK(simone).
% % :- format("addResource(balance)~n", []).
% % :- addResource(balance).
% % :- format("assignPredicate(enc, balance)~n", []).
% % :- assignPredicate(enc, balance).
% % :- format("addRole(staff)~n", []).
% % :- addRole(staff).
% % :- format("assignUserToRole(simone, staff)~n", []).
% % :- assignUserToRole(simone, staff).
% % :- format("assignPermissionToRole(staff, read, balance)~n", []).
% % :- assignPermissionToRole(staff, read, balance).
% % :- assignPredicate(colludingProne, simone).
% % :- assignPredicate(cspNoEnforce, balance).