示例#1
0
 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"})