I was asked, if there is a way to disable SHARE button for users with Contribute / Edit access in SharePoint. I did notice blogs talking about using code to hide SHARE button from SharePoint Ribbon and I was sure I can deny access using OOB way with Permission level and fortunately had enough time to blog my finding which might help you.
- Login to SharePoint Online site collection
- Navigate to Site Settings --> Site Permissions --> Access Request Settings
- Click on Permission level from Site Settings
- I choose Edit Permission level for this testing (Edit is the permission level mapped to Members group by default).
- Uncheck “Browse User Information – View information about users of the website” which disables Use Self-Service Site Creation and Edit Personal User Information by default.
- Tested the permission with user AllieB who is part of the Site Member group
- When AllieB clicks on Share from the top Ribbon, she gets access denied as shown below.
- When AllieB clicks on Share from Document library she get the same access denied error. This behavior is same while AllieB uses Share from Document more option.
This way, you can restrict share button for users with read and write 🙂
Hope this helps !..
Do try this on a test environment before implementing it on a Production site.