Index: binary-improvements2/WebServer/src/WebAPI/APIs/Permissions/WebModules.cs
===================================================================
--- binary-improvements2/WebServer/src/WebAPI/APIs/Permissions/WebModules.cs	(revision 434)
+++ binary-improvements2/WebServer/src/WebAPI/APIs/Permissions/WebModules.cs	(revision 435)
@@ -1,2 +1,3 @@
+using System;
 using System.Collections.Generic;
 using System.Net;
@@ -67,5 +68,5 @@
 			_writer.WriteInt32 (_module.LevelGlobal);
 			_writer.WriteRaw (jsonKeyPermissionLevelPerMethod);
-			
+
 			_writer.WriteBeginObject ();
 
@@ -74,5 +75,5 @@
 				for (int iMethod = 0; iMethod < _module.LevelPerMethod.Length; iMethod++) {
 					int methodLevel = _module.LevelPerMethod [iMethod];
-						
+
 					if (methodLevel == AdminWebModules.MethodLevelNotSupported) {
 						continue;
@@ -84,8 +85,8 @@
 
 					first = false;
-						
+
 					_writer.WriteRaw (jsonMethodNameKeys [iMethod]);
 					if (methodLevel == AdminWebModules.MethodLevelInheritGlobal) {
-						_writer.WriteString ("inherit");
+						_writer.WriteString (AdminWebModules.MethodLevelInheritKeyword);
 					} else {
 						_writer.WriteInt32 (methodLevel);
@@ -95,8 +96,8 @@
 
 			_writer.WriteEndObject ();
-			
+
 			_writer.WriteRaw (jsonKeyIsDefault);
 			_writer.WriteBoolean (_module.IsDefault);
-			
+
 			_writer.WriteEndObject ();
 		}
@@ -105,6 +106,4 @@
 			string id = _context.RequestPath;
 
-			// TODO
-			
 			if (string.IsNullOrEmpty (id)) {
 				SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "NO_MODULE");
@@ -112,10 +111,64 @@
 			}
 
-			if (!JsonCommons.TryGetJsonField (_jsonInput, propertyPermissionLevelGlobal, out int permissionLevel)) {
-				SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "NO_OR_INVALID_PERMISSION_LEVEL");
+			if (!AdminWebModules.Instance.IsKnownModule (id)) {
+				SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "INVALID_MODULE");
 				return;
 			}
 
-			// ModulesInstance.AddModule (id, permissionLevel);
+			AdminWebModules.WebModule module = AdminWebModules.Instance.GetModule (id);
+
+			if (_jsonInput.ContainsKey (propertyPermissionLevelGlobal)) {
+				if (!JsonCommons.TryGetJsonField (_jsonInput, propertyPermissionLevelGlobal, out int permissionLevelGlobal)) {
+					SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "INVALID_PERMISSION_LEVEL_GLOBAL");
+					return;
+				}
+
+				module.LevelGlobal = permissionLevelGlobal;
+			}
+
+			if (_jsonInput.TryGetValue (propertyPermissionLevelPerMethod, out object perLevelField)) {
+				if (perLevelField is not IDictionary<string, object> perLevelObj) {
+					SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "INVALID_PERMISSION_LEVEL_PER_METHOD_PROPERTY");
+					return;
+				}
+
+				foreach ((string property, object valueObj) in perLevelObj) {
+					if (!EnumUtils.TryParse (property, out ERequestMethod method, true)) {
+						SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "INVALID_METHOD_NAME");
+						return;
+					}
+
+					if (module.LevelPerMethod == null || module.LevelPerMethod [(int)method] == AdminWebModules.MethodLevelNotSupported) {
+						SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "UNSUPPORTED_METHOD");
+						return;
+					}
+
+					int permissionLevel;
+
+					if (valueObj is string valueString) {
+						if (!valueString.EqualsCaseInsensitive (AdminWebModules.MethodLevelInheritKeyword)) {
+							SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "INVALID_PERMISSION_STRING");
+							return;
+						}						
+
+						permissionLevel = AdminWebModules.MethodLevelInheritGlobal;
+					} else if (valueObj is double valueDbl) {
+						try {
+							permissionLevel = (int)valueDbl;
+						} catch (Exception) {
+							SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "INVALID_PERMISSION_VALUE");
+							return;
+						}
+					} else {
+						SendEmptyResponse (_context, HttpStatusCode.BadRequest, _jsonInputData, "INVALID_PERMISSION_VALUE_TYPE");
+						return;
+					}
+
+					module.LevelPerMethod [(int)method] = permissionLevel;
+				}
+			}
+
+			module.IsDefault = false;
+			ModulesInstance.AddModule (module);
 
 			SendEmptyResponse (_context, HttpStatusCode.Created);
