SOLVED

SharePoint "Sites" Web Parts - Selected Sites Needs to be Security Trimmed

%3CLINGO-SUB%20id%3D%22lingo-sub-276334%22%20slang%3D%22en-US%22%3ESharePoint%20%22Sites%22%20Web%20Parts%20-%20Selected%20Sites%20Needs%20to%20be%20Security%20Trimmed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-276334%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20very%20real%20need%20to%20show%20only%20specific%20sites%20in%20a%20Sites%20Web%20Part.%20I%20know%20this%20is%20doable%20and%20have%20been%20successful.%20However%2C%20the%20issue%20is%20that%20when%20I%20select%20individual%20sites%2C%20the%20security%20trimming%20goes%20away.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20select%20%22all%20sites%20in%20this%20hub%2C%22%20the%20list%20IS%20security%20trimmed.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20way%20to%20turn%20on%20the%20security%20trimming%20for%20a%20selected%20list%20from%20the%20Modern%20Sites%20Web%20Part%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-276334%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-277062%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20%22Sites%22%20Web%20Parts%20-%20Selected%20Sites%20Needs%20to%20be%20Security%20Trimmed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-277062%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20John.%20I%20figured%20that%20was%20the%20case.%20I%20understand%20about%20page%20performance%2C%20but%20this%20is%20definitely%20something%20that%20would%20benefit%20my%20company.%20I%20appreciate%20your%20response.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-277053%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20%22Sites%22%20Web%20Parts%20-%20Selected%20Sites%20Needs%20to%20be%20Security%20Trimmed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-277053%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20isn't%20currently%20a%20supported%20capability%20in%20the%20sites%20web%20part.%20In%20%22select%22%20mode%20you're%20defining%20specific%20sites%2Flinks%20to%20display.%20SharePoint%20displays%20them.%20If%20the%20user%20doesn't%20have%20access%20to%20the%20site%20they%20won't%20see%20the%20tidbits%20or%20info%20about%20the%20site%20(as%20we%20do%20a%20search%20query%20to%20retrieve%20that%20data%20from%20the%20site%2C%20as%20the%20user)%2C%20but%20they'll%20still%20see%20the%20site%20as%20you've%20specifically%20chosen%20to%20display%20it.%20This%20is%20similar%20to%20modern%20navigation%20and%20quick%20links.%20If%20you%20choose%20to%20display%20X%20site%2C%20we%20display%20it.%20If%20the%20user%20clicks%20it%2C%20they%20don't%20have%20access%20to%20it%20(of%20course).%20Security%20trimming%20explicitly%20added%20user%20content%20would%20seem%20to%20me%20to%20be%20counter-intuitive...%20not%20to%20mention%20not%20very%20performant%20for%20page%20loading%20(if%20every%20link%20added%20to%20every%20page%20had%20to%20be%20checked%20for%20permissions%20to%20simply%20display%20the%20link%20for%20every%20viewer).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAlways%20open%20to%20feedback%20on%20what%20we've%20created%2C%20and%20how%20we%20can%20improve%20it.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-277014%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20%22Sites%22%20Web%20Parts%20-%20Selected%20Sites%20Needs%20to%20be%20Security%20Trimmed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-277014%22%20slang%3D%22en-US%22%3E%3CP%3EWhen%20I%20select%20%22All%20Sites%20in%20Hub%22%20the%20web%20part%20is%20security%20trimmed.%20I%20am%20only%20seeing%20what%20I%20have%20permission%20to.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20when%20I%20click%20on%20%22Select%20Sites%22%20and%20manually%20select%20the%20site%20to%20list%2C%20I%20see%20all%20the%20sites%20regardless%20if%20I%20have%20permission%20to%20see%20them.%20I%20get%20a%20%22You%20need%20permission%20to%20access%20this%20site%22%20when%20I%20click%20on%20them.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIdeally%2C%20I%20would%20like%20to%20be%20able%20to%20use%20the%20%22Select%20Sites%22%20but%20still%20have%20it%20security%20trimmed.%20Meaning%20of%20the%20sites%20I%20select%2C%20I%20still%20only%20see%20those%20I%20have%20permission%20to%20see.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-276469%22%20slang%3D%22en-US%22%3ERe%3A%20SharePoint%20%22Sites%22%20Web%20Parts%20-%20Selected%20Sites%20Needs%20to%20be%20Security%20Trimmed%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-276469%22%20slang%3D%22en-US%22%3EIt%20should%20still%20do%20security%20trimming%2C%20similar%20to%20how%20news%20works.%20Are%20you%20sure%20it's%20not%20trimming%20the%20sites%3F%20Do%20you%20get%20an%20error%20on%20the%20sites%20where%20they%20show%20up%20at%20all%3F%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

I have a very real need to show only specific sites in a Sites Web Part. I know this is doable and have been successful. However, the issue is that when I select individual sites, the security trimming goes away. 

 

When I select "all sites in this hub," the list IS security trimmed.

 

Is there a way to turn on the security trimming for a selected list from the Modern Sites Web Part?

4 Replies
Highlighted
It should still do security trimming, similar to how news works. Are you sure it's not trimming the sites? Do you get an error on the sites where they show up at all?
Highlighted

When I select "All Sites in Hub" the web part is security trimmed. I am only seeing what I have permission to.

 

However, when I click on "Select Sites" and manually select the site to list, I see all the sites regardless if I have permission to see them. I get a "You need permission to access this site" when I click on them.

 

Ideally, I would like to be able to use the "Select Sites" but still have it security trimmed. Meaning of the sites I select, I still only see those I have permission to see.

Highlighted
Best Response confirmed by Beth Mahoneyadm (Occasional Contributor)
Solution

This isn't currently a supported capability in the sites web part. In "select" mode you're defining specific sites/links to display. SharePoint displays them. If the user doesn't have access to the site they won't see the tidbits or info about the site (as we do a search query to retrieve that data from the site, as the user), but they'll still see the site as you've specifically chosen to display it. This is similar to modern navigation and quick links. If you choose to display X site, we display it. If the user clicks it, they don't have access to it (of course). Security trimming explicitly added user content would seem to me to be counter-intuitive... not to mention not very performant for page loading (if every link added to every page had to be checked for permissions to simply display the link for every viewer).

 

Always open to feedback on what we've created, and how we can improve it.

Highlighted

Thanks John. I figured that was the case. I understand about page performance, but this is definitely something that would benefit my company. I appreciate your response.