I am able to create a shared link using the Box for Salesforce SDK, however I am unable to set specific permissions. For example I want to disable the download permission.

The Box for Salesforce SDK: https://github.com/box/box-salesforce-sdk

To create a shared link: https://github.com/box/box-salesforce-sdk/blob/master/doc/folders.md#created-a-shared-link-for-a-folder

BoxSharedLink.Permissions permissions = new BoxSharedLink.Permissions();
BoxFolder folder = new BoxFolder(api, 'folder-id');
SharedLink link = folder.createSharedLink(BoxSharedLink.Access.OPEN, null, permissions);

I tried, but the properties are null:

BoxSharedLink.Permissions permissions = new BoxSharedLink.Permissions('{"canDownload":"false", "canPreview":"true"}');
System.debug('*** Perm: ' + permissions.canDownload);

The permission class: https://github.com/box/box-salesforce-sdk/blob/e7fc7625b9b4316eee79af51ba1e412701494cdf/src/classes/BoxSharedLink.cls#L150

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.