Browse Source

Testing for bug fixing

Paolo Galli 4 years ago
parent
commit
6f77281410
1 changed files with 6 additions and 3 deletions
  1. 6 3
      lcmlog-server

+ 6 - 3
lcmlog-server

@@ -259,8 +259,10 @@ def auth(user_id, method, kind):
 	# Check if user id is in auth files
 	# We suppose that every authorized user is ONLY IN A FILE!
 	user_type = ""
-	for file_name in ["150","Admin","Valhalla","Nirvana"]:
-		with open(DIR + "/auth/" + file_name) as f:
+	print("prefor")
+        for file_name in ["150","Admin","Valhalla","Nirvana"]:
+		print("prewith")
+                with open(DIR + "/auth/" + file_name) as f:
 			for line in f:
 				line = line.split()[0]
 				if int(line) == user_id:
@@ -273,7 +275,8 @@ def auth(user_id, method, kind):
 		# If not in auth files, the user cannot do anything
 		raise AuthError()
 	# Now we check the user type permissions
-	auth_list = toml.load(DIR + "/auth/auth.toml")[user_type]["auth"]
+	print("pretoml")
+        auth_list = toml.load(DIR + "/auth/auth.toml")[user_type]["auth"]
 	if not method + " " + kind in auth_list:
 		raise AuthError()
 	return