Esri/arcgis-rest-js

Add getUserFolders() to portal package

开放

#765 创建于 2020年10月2日

 (1 条评论) (0 个反应) (0 位负责人)TypeScript (126 个派生)auto 404
good first issue

仓库指标

星标
 (389 个星标)
PR 合并指标
 (PR 指标待抓取)

描述

Folders are returned with the payload of /content/users/{username}. If we pass in ?num=1, the response will only contain a single item, but all the folders.

Below is a working example from the Hub e2e purge system

export function getUserFolders (session) {
  const user = await session.getUser();
  const url = `${session.portal}/content/users/${user.username}?num=1`;
  return request(url, { authentication: session })
    .then((response) => {
      return response.folders || [];
    });
}

I verified that we can fetch folders for other users, so having an optional username param would be useful... I'm not clear what limitations/requirements there are for being able to get another users folders... i.e. does the auth'd user need to be an orgAdmin or can any user get this info? or is there a priv?

贡献者指南