def delete(self, rule_ref_or_id, requester_user):
        """
        Delete a rule.

        Handles requests:
            DELETE /rules/1
        """
        rule_db = self._get_by_ref_or_id(ref_or_id=rule_ref_or_id)

        permission_type = PermissionType.RULE_DELETE
        rbac_utils = get_rbac_backend().get_utils_class()
        rbac_utils.assert_user_has_resource_db_permission(
            user_db=requester_user, resource_db=rule_db, permission_type=permission_type
        )

        LOG.debug(
            "DELETE /rules/ lookup with id=%s found object: %s", rule_ref_or_id, rule_db
        )
        try:
            Rule.delete(rule_db)
        except Exception as e:
            LOG.exception(
                'Database delete encountered exception during delete of id="%s".',
                rule_ref_or_id,
            )
            abort(http_client.INTERNAL_SERVER_ERROR, six.text_type(e))
            return

        # use old_rule_db for cleanup.
        cleanup_trigger_db_for_rule(rule_db)

        extra = {"rule_db": rule_db}
        LOG.audit("Rule deleted. Rule.id=%s." % (rule_db.id), extra=extra)

        return Response(status=http_client.NO_CONTENT)

        Delete a rule.

        Handles requests:
            DELETE /rules/1
        
st2api/st2api/controllers/v1/rules.py