none
SharePoint Online sharing, NoScript Isnt enabled on the hostsite

    Question

  • I've created some functions that is really about sharing objects with external users via the JSOM api in SharePoint.

        

        var result = SP.Web.shareObject(ctx, urlToDocument,
                                                peoplePickerInput, roleValue, groupId, propageAcl,
                                                sendEmail, includedAnonymousLinkInEmail, emailSubject,
                                                emailBody, useSimplifiedRoles);

    The code is working fine while in a scripteditor on a page in the same site as the library I'm sharing objects from. Then I get statuscode 0 and the user gets an email invitation.

    But when I try the same code from a page in another site or even a SharePoint Hosted App i get: statuscode -3 and errormessage: 

        "MountPoint security error: NoScript isn't enabled on the host site
        
    Wednesday, April 27, 2016 5:36 AM

Answers

  • It turns out that error comes from using a different ClientContext than the location of the object being shared.

    so "var ctx = new SP.ClientContext(sameUrLAsLocationOfObject);"
    Monday, May 2, 2016 9:35 AM

All replies

  • have you checked the custom scripting options.

    https://support.office.com/en-us/article/Turn-scripting-capabilities-on-or-off-1f2c515f-5d7e-448a-9fd7-835da935584f?ui=en-US&amp%3brs=en-US&amp%3bad=US&rs=en-US&ad=US


    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://krossfarm.com

    Wednesday, April 27, 2016 5:58 AM
  • It turns out that error comes from using a different ClientContext than the location of the object being shared.

    so "var ctx = new SP.ClientContext(sameUrLAsLocationOfObject);"
    Monday, May 2, 2016 9:35 AM