code: function flattenAll() {
          var result = [];
          for (var role in permissions) {
              result = result.concat(flatten(role));
          }
          return uniq(result);
      }
docs: FLatten the whole map