Пример #1
0
    def delete(self, uuid=None, perimeter_id=None, user_id=None):
        """Delete a action for a given policy

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

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

        return {"result": True}
Пример #2
0
    def delete(self, uuid=None, perimeter_id=None, user_id=None):
        """Delete a action for a given policy

        :param uuid: uuid of the policy
        :param perimeter_id: uuid of the action
        :param user_id: user ID who do the request
        :return: {
                "action_id": {
                    "name": "name of the action",
                    "description": "description of the action"
            }
        }
        :internal_api: delete_action
        """
        try:
            data = PolicyManager.delete_action(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}
Пример #3
0
def delete_action(policy_id, perimeter_id):
    from python_moondb.core import PolicyManager
    PolicyManager.delete_action("", policy_id, perimeter_id)