inheritSharings
Applies a parent folder's sharing to file(s) that were just uploaded into it — so a file lands with the same sharing everyone else already has on that folder, rather than defaulting to just the uploading user's own access.
How to call this method
global static void inheritSharings(List<String> wipIdList, String currentFolderId)
global static void inheritSharings(List<String> wipIdList, String currentFolderId, String customObjectNameAT)
Parameters
|
Parameter |
Type |
Required |
Description |
|---|---|---|---|
|
|
|
Yes |
Ids of the file record(s) to share — the file records that were just uploaded. |
|
|
|
Yes |
Id of the parent folder to inherit sharing from. |
|
|
|
No |
For a custom file object, the API name of that object's sharing table — its |
Return value
Doesn't return anything.
Example
List<String> wipIdList = new List<String>();
wipIdList.add(uploadRequestInfos[0].wipFileId);
cg.SDriveTools.inheritSharings(wipIdList, currentFolderId);