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