SOLVED

Show content based on user permission (group)

%3CLINGO-SUB%20id%3D%22lingo-sub-1712159%22%20slang%3D%22en-US%22%3EShow%20content%20based%20on%20user%20permission%20(group)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1712159%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20SP%20modern%20site.%3C%2FP%3E%3CP%3EHow%20can%20i%20hide%20or%20show%20content%20on%20a%20site%20if%20the%20user%20is%20part%20of%20a%20specific%20group%20or%20not%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20hide%20some%20content%20if%20the%20user%20is%20not%20member%20of%20a%20specific%20group.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1712159%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPermissions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EResponsive%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESites%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1713893%22%20slang%3D%22en-US%22%3ERE%3A%20Show%20content%20based%20on%20user%20permission%20(group)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1713893%22%20slang%3D%22en-US%22%3EHello%20Oskar%2C%20is%20it%20a%20Team%20or%20communication%20site%20%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1717994%22%20slang%3D%22en-US%22%3ERE%3A%20Show%20content%20based%20on%20user%20permission%20(group)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1717994%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F284426%22%20target%3D%22_blank%22%3E%40ArefHalmstrand%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ei%20woud%20say%20both...%20i%20am%20looking%20to%20do%20this%20on%20communication%20sites%20and%20team%20sites.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eidea%20i%20have%20is%20that%20i%20want%20to%20build%20a%20site%20on%20different%20locations%20and%20show%20content%20based%20on%20who%20the%20viewer%20is.%20maybe%20this%20is%20not%20possible%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1718087%22%20slang%3D%22en-US%22%3ERE%3A%20Show%20content%20based%20on%20user%20permission%20(group)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1718087%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F89819%22%20target%3D%22_blank%22%3E%40Oskar%20Kuus%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EOkay!%20There%20are%20many%20ways%20to%20solve%20permission%20challenges.%20However%2C%20because%20MS%20Teams%20is%20so%20frequently%20used%2C%20I%20strongly%20recommend%20using%20team%20sites%20for%20the%20content%2C%20while%20communication%20sites%20can%20be%20used%20as%20landing%20page%20that%20fetches%20that%20content.%20The%20content%20can%20be%20easily%20shown%20with%20the%20beautiful%20%22highlighted%20content%22%20web%20part.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ESo%2C%20for%20each%20area%20with%20unique%20content%20and%20permissions%3A%3CBR%20%2F%3ECreate%20a%20team%20site%2C%20connect%20it%20to%20MS%20Teams.%20Have%20a%20communication%20site%20as%20a%20landing%20page%20for%20all%20these%20people%20who%20will%20have%20access%20to%20this%20information.%20Make%20the%20communication%20site%20dynamic%20by%20connecting%20it%20to%20hub%20sites%20and%20use%20highlighted%20content%20web%20part%20(there%20are%20more%20good%20web%20parts%20to%20use).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1718159%22%20slang%3D%22en-US%22%3ERE%3A%20Show%20content%20based%20on%20user%20permission%20(group)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1718159%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F284426%22%20target%3D%22_blank%22%3E%40ArefHalmstrand%3C%2FA%3Ethank%20you%20very%20much!%20No%20rush%20tho%2C%20time%20is%20midnight%20here%20so%20ill%20be%20falling%20asleep%20soon%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1718161%22%20slang%3D%22en-US%22%3ERE%3A%20Show%20content%20based%20on%20user%20permission%20(group)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1718161%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F89819%22%20target%3D%22_blank%22%3E%40Oskar%20Kuus%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ENo%20worries%2C%20I%20will%20write%20it%20all%20down%20and%20you%20can%20check%20on%20it%20whenever%20it%20suits%20you%20%3A)%3C%2Fimg%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3ESo%20what%20I%20will%20do%20is%20to%20first%20explain%20the%20major%20differences%20between%20communication%20sites%20and%20team%20sites%2C%20use%20of%20hub%20sites%20and%20why%20its%20important.%20The%20architecture%20I%20will%20present%20to%20you%20is%20one%20solution%20that%20I%20personally%20believe%20to%20be%20strongest%20on%20the%20long%20run.%20However%2C%20with%20that%20said%2C%20there%20are%20many%20other%20ways%20to%20solve%20your%20current%20challenge.%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EFinally%2C%20If%20you%20would%20like%20a%20demo%20or%20more%20help%20to%20setup%20the%20architecture%2C%20I%20could%20gladly%20help%20through%20MS%20Teams.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Frequent Contributor

I have SP modern site.

How can i hide or show content on a site if the user is part of a specific group or not?

 

I want to hide some content if the user is not member of a specific group.

 

15 Replies
Highlighted
Hello Oskar, is it a Team or communication site ?
Highlighted

@ArefHalmstrand 

i woud say both... i am looking to do this on communication sites and team sites.

 

idea i have is that i want to build a site on different locations and show content based on who the viewer is. maybe this is not possible?

Highlighted

@Oskar Kuus 

Okay! There are many ways to solve permission challenges. However, because MS Teams is so frequently used, I strongly recommend using team sites for the content, while communication sites can be used as landing page that fetches that content. The content can be easily shown with the beautiful "highlighted content" web part. 

So, for each area with unique content and permissions:
Create a team site, connect it to MS Teams. Have a communication site as a landing page for all these people who will have access to this information. Make the communication site dynamic by connecting it to hub sites and use highlighted content web part (there are more good web parts to use).

Highlighted

@ArefHalmstrandok you lost me :)

 

i dont know what you mean by half of what you are writing. connecting to a hub-site etc....

 

I have a SP site/page

On this have a  webpart containing a bunch of links

I want that webpart to show if the user is part of group A

if user is not part of group A, then i want to show another webpart for the user.

 

or another solution could be.

if user is part of group A. then redirect user to xxx adress.

if user is not part of group B, then redirect user to yyy adress.

 

i want to point all users to one site. but show them personalized content based on the group they are member of.

 

Highlighted

@Oskar Kuus 

Haha I am sorry! Let me ask, what version of SharePoint are you using? Is it on-premises or SharePoint Online?

Highlighted

@ArefHalmstrandno clue on how to check sharepoint version.

we are using sharepoint online.

 

 

Highlighted

@Oskar Kuus 

Okay good! :)  SharePoint Online is updated regularly and you as a consumer does not need to think about version number.

Highlighted

@Oskar Kuus 

Give me 10-20 minutes to finish something and I will come back to this chat to explain how you can solve your current challenge :)

Highlighted

@ArefHalmstrandthank you very much! No rush tho, time is midnight here so ill be falling asleep soon :)

Highlighted

@Oskar Kuus 

No worries, I will write it all down and you can check on it whenever it suits you :) 

So what I will do is to first explain the major differences between communication sites and team sites, use of hub sites and why its important. The architecture I will present to you is one solution that I personally believe to be strongest on the long run. However, with that said, there are many other ways to solve your current challenge. 

Finally, If you would like a demo or more help to setup the architecture, I could gladly help through MS Teams.

Highlighted
Best Response confirmed by Oskar Kuus (Frequent Contributor)
Solution

@Oskar Kuus  , If this answer below was what you were looking for, could you please mark as best answer? 

The new modern sites consist of Communication sites, Team sites and ultimately Hub sites.

Communication Site
The communication site is way better when it comes to design, you have the possibility to use full-width web parts and the default templates that exists are perfect examples for why communication sites are meant to be landing pages. Communication sites alone are not so useful, they have no connection to Microsoft 365 groups and can not be connected to MS Teams. However, using a communication site as a landing page, it can be upgraded to a Hub site. To update the communication site into a Hub site, please visit the SharePoint Admin center and you will find the configuration button in the menu. I will explain more about Hub sites later.

Team site
The name really says it all. The site is created with a purpose to help a team work together. Microsoft 365 group is created and with these groups, you can add people that should have access to specific content. The Team site can be connected to MS Teams and that gives you the possibility to allow your users to communicate and work with files both in SharePoint and Teams. The strength of Team site connected to MS Teams is the flexibility to work everywhere. Co-authoring, chatting inside of documents and all secured while the conversations are saved in MS Teams. Team sites are powerful to handle teams and their content in a secure way. However, this does not solve your issue because you need one site that all users access, and see their own content, in a secure way. This will be solved by using a Hub site.

 

Hub site

The Hub site is created by activating the Hub site feature on a communication site through the SharePoint admin center. The Hub site by itself is not really anything special. However, in the SharePoint admin center, select your team sites and connect them to your new Hub site. By connecting sites to the Hub, you allow the sites to communicate with each other (something truly underestimated, hats of to the developers!). Connecting sites together, allows you to fetch data from any of the connected sources, simply by selecting the site while editing a web part. By default the SharePoint Search bar will be searching through your entire hub. The content shown and searchable is always content that you have access to. So when the access is handled by Microsoft 365 groups, you do not need to be worry about anything (as long as you do not have shadow admins).

 

Highlighted content web part

This is one of my favorite out-of-the-box web parts. It is included in SharePoint Online and you simply need to add it in your communication site while editing the page. When the web part is on place, you will most likely see content immediately. Click on the pen to the left of the web part (edit-icon), and there you will have the possibility to add or remove sites that should show data. Everything connected through the Hub site configuration that you made before. 

I hope this gave you some inspiration and idea on how to solve your challenge. For further assistance, please contact me and we will see what we can do. :) 
 

Highlighted

@ArefHalmstrand Thanks so much for this excellent and concise explanation.  I am considering something similar so the timing on this is perfect! 

I do, however, have two questions that I just want to confirm or get more clarification: 

 

1. I'm not sure what you mean by this phrase under the Hub section: "Connecting sites together, allows you to fetch data from any of the connected sources, simply by selecting the site while editing a web part. "  I suspect here that you mean to select the source site when setting up the highlighted web part. 

2. Will the Team to which you are referring have multiple groups in it or is there a Team for each group?  It sounds like 1 team. 

Have not yet used the Highlighted Content Web part.  Based on your recommended, I'm looking forward to checking it out!  


Highlighted

@Cindy Zalme 

I am glad that I can help! :) 

1. You are correct! If you have five different sites connected to the Hub site, in the web part, you can decide to fetch content from all five, or only three, set unique filters and rules to how and what content should be shown.

 

2. Each team will have its own group. 1 MS365 group (also known as Office 365 group) per team. 

 

I hope it works out as you hoped! Good luck :) 

Highlighted

@ArefHalmstrand Got it!  Thank you ever so much! 

Highlighted
You are so welcome! If this helped you, could you please like my messages? I am trying to build some statistics on my posts in relation to best answers and likes. :)