def delete_user(self, userid): # Check if the user is an admin if cherrypy.session.get("usertype", "user") == "admin": return API.delete_user(userid) else: return json.dumps({"error": "User not authorized for this request"})