code: function getParent(role) {
          var result = [];
  
          for (var parentRole in permissions) {
              if (permissions[parentRole].indexOf(role) > -1) {
                  result.push(parentRole);
                  result = result.concat(getParent(parentRole));
              }
          }
          return result;
      }
docs: Remove parent permissions from flattenpermissions when subpermissions aren't found within it