Skip to content

Commit

Permalink
Merge pull request #609 from Esri/bug/item-access
Browse files Browse the repository at this point in the history
fix(portal): setting item access to public shares correctly
  • Loading branch information
tomwayson authored Aug 8, 2019
2 parents 1635eb2 + 6a2b115 commit 025406e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion packages/arcgis-rest-portal/src/sharing/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ function updateItemAccess(
}
// if sharing with everyone, share with the entire organization as well.
if (requestOptions.access === "public") {
requestOptions.params.org = true;
// this is how the ArcGIS Online Home app sets public access
// setting org = true instead of account = true will cancel out all sharing
requestOptions.params.account = true;
requestOptions.params.everyone = true;
}
return request(url, requestOptions);
Expand Down
2 changes: 1 addition & 1 deletion packages/arcgis-rest-portal/test/sharing/access.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ describe("setItemAccess()", () => {
expect(response).toEqual(SharingResponse);
expect(options.body).toContain("f=json");
expect(options.body).toContain("everyone=true");
expect(options.body).toContain("org=true");
expect(options.body).toContain("account=true");
done();
})
.catch(e => {
Expand Down

0 comments on commit 025406e

Please sign in to comment.