Question

I have created a very basic SP site in SP Online. I am using modern pages. Basically I have some promoted links (using third party app) that users can click and open up different apps, links, etc.

I only want two groups:

a) Admins who can edit the links and graphics and change the site b) Everyone else, who can ONLY click on the links. Don't want them to add/change/delete pages or links or anything.

Looking at the picture below I want the parts marked with a red line to be hidden to everyone in the site EXCEPT the admins.

How in the world do I do this? Should be simple.

Please someone I have been working on and off in SP for a year and STILL cannot find a way to do this very simple thing.

enter image description here

Was it helpful?

Solution

You need to add custom script to hide the sections. Inspect all sections and get the class. Hide them using jQuery based on condition. You can do it using 2 ways:

  1. Develop an extension which will hide the marked section if user do not have full control permission. This is best practice approach. Use below link to getting started with extension https://docs.microsoft.com/en-us/sharepoint/dev/spfx/extensions/get-started/build-a-hello-world-extension

  2. Add script editor to your page. Inject your script inside it. This is easy solution but not best practice. You can find the package on below link: https://github.com/SharePoint/sp-dev-fx-webparts/tree/master/samples/react-script-editor

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top