aboutsummaryrefslogtreecommitdiffstats
path: root/moon_manager/tests/unit_python/helpers/assignment_helper.py
blob: 05d13c46f0b2243e9fb9b1276ca60c09a623e12d (plain)
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
# Software Name: MOON

# Version: 5.4

# SPDX-FileCopyrightText: Copyright (c) 2018-2020 Orange and its contributors
# SPDX-License-Identifier: Apache-2.0

# This software is distributed under the 'Apache License 2.0',
# the text of which is available at 'http://www.apache.org/licenses/LICENSE-2.0.txt'
# or see the "LICENSE" file for more details.



def get_action_assignments(policy_id, action_id=None, category_id=None):
    from moon_manager.db_driver import PolicyManager
    return PolicyManager.get_action_assignments("", policy_id, action_id, category_id)


def add_action_assignment(policy_id, action_id, category_id, data_id):
    from moon_manager.db_driver import PolicyManager
    return PolicyManager.add_action_assignment("", policy_id, action_id, category_id, data_id)


def delete_action_assignment(policy_id, action_id, category_id, data_id):
    from moon_manager.db_driver import PolicyManager
    PolicyManager.delete_action_assignment("", policy_id, action_id, category_id, data_id)


def get_object_assignments(policy_id, object_id=None, category_id=None):
    from moon_manager.db_driver import PolicyManager
    return PolicyManager.get_object_assignments("", policy_id, object_id, category_id)


def add_object_assignment(policy_id, object_id, category_id, data_id):
    from moon_manager.db_driver import PolicyManager
    return PolicyManager.add_object_assignment("", policy_id, object_id, category_id, data_id)


def delete_object_assignment(policy_id, object_id, category_id, data_id):
    from moon_manager.db_driver import PolicyManager
    PolicyManager.delete_object_assignment("", policy_id, object_id, category_id, data_id)


def get_subject_assignments(policy_id, subject_id=None, category_id=None):
    from moon_manager.db_driver import PolicyManager
    return PolicyManager.get_subject_assignments("", policy_id, subject_id, category_id)


def add_subject_assignment(policy_id, subject_id, category_id, data_id):
    from moon_manager.db_driver import PolicyManager
    return PolicyManager.add_subject_assignment("", policy_id, subject_id, category_id, data_id)


def delete_subject_assignment(policy_id, subject_id, category_id, data_id):
    from moon_manager.db_driver import PolicyManager
    PolicyManager.delete_subject_assignment("", policy_id, subject_id, category_id, data_id)