def delete(self, uuid=None, perimeter_id=None, category_id=None, data_id=None, user_id=None): """Delete a subject assignment for a given policy :param uuid: uuid of the policy :param perimeter_id: uuid of the subject :param category_id: uuid of the subject category :param data_id: uuid of the subject scope :param user_id: user ID who do the request :return: { "result": "True or False", "message": "optional message" } :internal_api: delete_subject_assignment """ try: data = PolicyManager.delete_subject_assignment( user_id=user_id, policy_id=uuid, subject_id=perimeter_id, category_id=category_id, data_id=data_id) except Exception as e: logger.error(e, exc_info=True) return {"result": False, "error": str(e)}, 500 return {"result": True}
def delete_subject_assignment(policy_id, subject_id, category_id, data_id): from python_moondb.core import PolicyManager PolicyManager.delete_subject_assignment("", policy_id, subject_id, category_id, data_id)