예제 #1
0
파일: data.py 프로젝트: sarpkoksal/moon
    def delete(self, uuid=None, category_id=None, data_id=None, user_id=None):
        """Delete a subject for a given policy

        :param uuid: uuid of the policy
        :param category_id: uuid of the subject category
        :param data_id: uuid of the subject data
        :param user_id: user ID who do the request
        :return: [{
            "result": "True or False",
            "message": "optional message (optional)"
        }]
        :internal_api: delete_subject_data
        """
        logger.info("api.delete {} {}".format(uuid, data_id))
        data = PolicyManager.delete_subject_data(user_id=user_id,
                                                 policy_id=uuid,
                                                 category_id=category_id,
                                                 data_id=data_id)

        return {"result": True}
예제 #2
0
    def delete(self, uuid=None, category_id=None, data_id=None, user_id=None):
        """Delete a subject for a given policy

        :param uuid: uuid of the policy
        :param category_id: uuid of the subject category
        :param data_id: uuid of the subject data
        :param user_id: user ID who do the request
        :return: [{
            "result": "True or False",
            "message": "optional message"
        }]
        :internal_api: delete_subject_data
        """
        try:
            data = PolicyManager.delete_subject_data(user_id=user_id,
                                                     policy_id=uuid,
                                                     data_id=data_id)
        except Exception as e:
            logger.error(e, exc_info=True)
            return {"result": False, "error": str(e)}, 500
        return {"result": True}
예제 #3
0
파일: test_data.py 프로젝트: Kryndex/moon
def delete_subject_data(policy_id, data_id):
    from python_moondb.core import PolicyManager
    PolicyManager.delete_subject_data("", policy_id, data_id)