'Throw exception for dangerous queries: `ALTER`, `DROP`, `TRUNCATE` if not `Administrator`.'

def validate_query(self, q):

    cmd = q.strip().lower().split()[0]
    if ((cmd in [u'alter', u'drop', u'truncate']) and (frappe.session.user != u'Administrator')):
        frappe.throw(_(u'Not    permitted'), frappe.PermissionError)
