mounttablelib: developer brain in neutral - fixed.

When building the database from the config, I didn't copy permissions
because I was breaking out early when there was no ctx or call passed in.

Also fixed reading in the config.  It is read into a map by json and when
going through the map, we screw up the ordering.  We now sort the keys of the
config nodes lexographically so that permissions are correctly inherited by
child nodes.

Change-Id: I6c53a5aa19be6f40415867db540f95d6514e0eed
diff --git a/services/mounttable/mounttablelib/versionedpermissions.go b/services/mounttable/mounttablelib/versionedpermissions.go
index 867be02..95a044a 100644
--- a/services/mounttable/mounttablelib/versionedpermissions.go
+++ b/services/mounttable/mounttablelib/versionedpermissions.go
@@ -9,6 +9,7 @@
 	"io"
 	"os"
 	"reflect"
+	"sort"
 	"strconv"
 	"strings"
 
@@ -108,7 +109,15 @@
 			}
 			return err
 		}
-		for name, perms := range pm {
+		// Sort the map shortest key first.  That way configs for nodes higher up in the
+		// name tree happen first ensuring that lower nodes correctly inherit permissions.
+		var keys []string
+		for name := range pm {
+			keys = append(keys, name)
+		}
+		sort.Strings(keys)
+		for _, name := range keys {
+			perms := pm[name]
 			var elems []string
 			isPattern := false