File tree 1 file changed +21
-1
lines changed
1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -24,5 +24,25 @@ def complext_test():
24
24
print lbac .acl
25
25
print lbac .request (user = "u1" ,object = "o6" ,action = "read" )
26
26
27
+
28
+ def simple_test_case ():
29
+ conf = Configuration ()
30
+
31
+ user_hierarchy = [ ("manager" ,["employee" ]), ("employee" ,["stuff" ]) ]
32
+
33
+ object_hierarchy = [ ("secret" , ["public" ]), ("confidential" ,["public" ]) ]
34
+
35
+ conf .object_label_hierarchy = object_hierarchy
36
+
37
+ conf .user_label_hierarchy = user_hierarchy
38
+
39
+ conf .add_policy ("read" ,[ ("confidential" ,"employee" ) ] )
40
+ # create LaBAC class with this configuration
41
+ lbac = LBAC (conf )
42
+ # now check if 'employee' can read 'confidential'
43
+ print lbac .request (user = 'employee' , object = 'confidential' , action = 'read' )
44
+
45
+
27
46
if __name__ == "__main__" :
28
- complext_test ()
47
+ #complext_test()
48
+ simple_test_case ()
You can’t perform that action at this time.
0 commit comments