3

In most cases, the ability to share documents is great, but in some cases, we'll need to prevent the users from sharing documents as it is messing up the permissions on that library.

I am aware of the option to block sharing on the site collection level, but in this, I just need it on library level. How do I do that?

1

SharePoint Online still not provide option to disable Sharing for a single library, here is the same UserVoice for this:

Provide an option to disable the "Share" button

One workaround come up is to use some Jquery code to hide the sharing menu if you are using SharePoint Online classic page.

<script type="text/javascript">
myVar = setInterval(hidesharing, 1000);
function hidesharing()
{
  $("span.ms-cui-ctl-largelabel:contains('Shared')").closest('a').hide();
  $("a[title='Share file or folder with other person or group']").hide();
  $("a[title='Share']").hide();
}
</script>

enter image description here

enter image description here

  • Not the answer I had hoped for, but thanks any way. Weird oversight on Microsofts part – Kasper Bo Larsen Nov 26 '18 at 17:35

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.