Example #1
0
    def delete(self, uuid=None, perimeter_id=None, user_id=None):
        """Delete a object for a given policy

        :param uuid: uuid of the policy (mandatory if perimeter_id is not set)
        :param perimeter_id: uuid of the object (mandatory if uuid is not set)
        :param user_id: user ID who do the request
        :return: {
                "object_id": {
                    "name": "name of the object",
                    "description": "description of the object (optional)"
            }
        }
        :internal_api: delete_object
        """

        data = PolicyManager.delete_object(user_id=user_id,
                                           policy_id=uuid,
                                           perimeter_id=perimeter_id)

        return {"result": True}
Example #2
0
    def delete(self, uuid=None, perimeter_id=None, user_id=None):
        """Delete a object for a given policy

        :param uuid: uuid of the policy
        :param perimeter_id: uuid of the object
        :param user_id: user ID who do the request
        :return: {
                "object_id": {
                    "name": "name of the object",
                    "description": "description of the object"
            }
        }
        :internal_api: delete_object
        """
        try:
            data = PolicyManager.delete_object(user_id=user_id,
                                               policy_id=uuid,
                                               perimeter_id=perimeter_id)
        except Exception as e:
            logger.error(e, exc_info=True)
            return {"result": False, "error": str(e)}, 500
        return {"result": True}
Example #3
0
def delete_object(policy_id, perimeter_id):
    from python_moondb.core import PolicyManager
    PolicyManager.delete_object("", policy_id, perimeter_id)