diff options
Diffstat (limited to 'moonv4/moon_interface/tests/apitests/scenario/rbac.py')
-rw-r--r-- | moonv4/moon_interface/tests/apitests/scenario/rbac.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/moonv4/moon_interface/tests/apitests/scenario/rbac.py b/moonv4/moon_interface/tests/apitests/scenario/rbac.py index cd08308e..a43bd1f4 100644 --- a/moonv4/moon_interface/tests/apitests/scenario/rbac.py +++ b/moonv4/moon_interface/tests/apitests/scenario/rbac.py @@ -15,7 +15,7 @@ subject_data = {"role": {"admin": "", "employee": ""}} object_data = {"id": {"vm0": "", "vm1": ""}} action_data = {"action-type": {"vm-action": "", }} -subject_assignments = {"user0": {"role": "admin"}, "user1": {"role": "employee"}, } +subject_assignments = {"user0": {"role": "employee"}, "user1": {"role": "employee"}, } object_assignments = {"vm0": {"id": "vm0"}, "vm1": {"id": "vm1"}} action_assignments = {"start": {"action-type": "vm-action"}, "stop": {"action-type": "vm-action"}} @@ -25,8 +25,18 @@ meta_rule = { rules = { "rbac": ( - ("admin", "vm0", "vm-action"), - ("admin", "vm1", "vm-action"), + { + "rule": ("admin", "vm0", "vm-action"), + "instructions": ( + {"decision": "grant"} # "grant" to immediately exit, "continue" to wait for the result of next policy + ) + }, + { + "rule": ("admin", "vm1", "vm-action"), + "instructions": ( + {"decision": "grant"} + ) + }, ) } |