|
@@ -258,10 +258,8 @@ 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 = ""
|
|
|
- print("prefor")
|
|
|
- for file_name in ["150","Admin","Valhalla","Nirvana"]:
|
|
|
- print("prewith")
|
|
|
- with open(DIR + "/auth/" + file_name) as f:
|
|
|
+ for file_name in ["150","Admin","Valhalla","Nirvana"]:
|
|
|
+ with open(DIR + "/auth/" + file_name) as f:
|
|
|
for line in f:
|
|
|
line = line.split()[0]
|
|
|
if int(line) == user_id:
|
|
@@ -274,8 +272,7 @@ 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
|
|
|
- print("pretoml")
|
|
|
- auth_list = toml.load(DIR + "/auth/auth.toml")[user_type]["auth"]
|
|
|
+ auth_list = toml.load(DIR + "/auth/auth.toml")[user_type]["auth"]
|
|
|
if not method + " " + kind in auth_list:
|
|
|
raise AuthError()
|
|
|
return
|