public Result fromJSON(JSONObject json, int version) {
		try {
			
			if(version > Privileges.JSON_VERSION)
				return IJson.Result.OUTDATED_APP;
			
			allowances = new ArrayList<String>();
			denials = new ArrayList<String>();
			
			if(version >= 1) {
				name = json.getString("name");
				
				JSONArray jsonAllow = json.optJSONArray("allow");
				if(jsonAllow != null) {
					int len = jsonAllow.length();
					for(int a=0; a<len; a++) {
						allowances.add(jsonAllow.getString(a));
					}
				}
				
				JSONArray jsonDeny = json.optJSONArray("deny");
				if(jsonDeny != null) {
					int len = jsonDeny.length();
					for(int a=0; a<len; a++) {
						denials.add(jsonDeny.getString(a));
					}
				}
			}
			if(version < Privileges.JSON_VERSION)
				return IJson.Result.OUTDATED_FORMAT;
			
			return IJson.Result.SUCCESS;
		}
		catch(Exception e) {
			e.printStackTrace();
			return IJson.Result.FAILURE;
		}
	}