Browse Source

Merge branch 'develop' of http://tuc/gogs/lcmstaff/lcmlog-server into develop

root 4 years ago
parent
commit
811eeeee8c
1 changed files with 6 additions and 3 deletions
  1. 6 3
      lcmlog-server

+ 6 - 3
lcmlog-server

@@ -258,8 +258,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:
@@ -272,7 +274,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