Forum Discussion
vassp1980
Jul 31, 2024Copper Contributor
Is it possible to show the "All Documents" view in a SharePoint Library only to admins
Hello All, There is a Document Library "working documents" that has two views. One is the "All Documents" view which shows all the documents uploaded by all people. There is another view "My Do...
JaredMatfess
Jul 31, 2024Iron Contributor
I think it's more of a security by-obscurity situation but you could potentially just hide the view using PNP PowerShell:
Connect-PnPOnline -Url <SiteUrl> -Credentials (Get-Credential)
$list = Get-PnPList -Identity "<ListName>"
$view = $list.Views.GetByName("<ViewName>")
$view.Hidden = $true
$view.Update()
--
Then, for your admins, you can include a link in the navigation to the URL for the view (that's hidden) and use audience targeting to share the URL with them.
That should technically enable what you're looking for. But remember, if a user has that URL they would be able to get to it.
Connect-PnPOnline -Url <SiteUrl> -Credentials (Get-Credential)
$list = Get-PnPList -Identity "<ListName>"
$view = $list.Views.GetByName("<ViewName>")
$view.Hidden = $true
$view.Update()
--
Then, for your admins, you can include a link in the navigation to the URL for the view (that's hidden) and use audience targeting to share the URL with them.
That should technically enable what you're looking for. But remember, if a user has that URL they would be able to get to it.