code: function flatten(role) {
          var children = permissions[role] || [];
          var result = [role];
  
          for (var i in children) {
              result = result.concat(flatten(children[i]));
          }
          return result;
      }
docs: Flatten the map of a role