Mask created/modified users in lists/libraries

You might want to hide created by and modified by information from the users. There are three ways to achieve this. First to way is masking the created by and modified by users in lists and libraries. Third one is actually a workaround by creating a new view which doesn’t have a name field with link to menu.

Masking user info by code

// hiding created by and modified by users
SPSecurity.RunWithElevatedPrivileges(delegate()
{
using (SPSite oSite = new SPSite(SPContext.Current.Web.Url))
{
using (SPWeb oWeb = oSite.OpenWeb())
{
SPList library = oWeb.Lists["Öneri Formları"];
library.ShowUser = false;
library.Update();
}
}
});

Masking user info by PowerShell

$SPweb=Get-SPWeb "http://sharepoint"
$SPlist=$SPweb.Lists["Tasks"]
$SPlist.ShowUser=$false
$SPlist.Update()

Workarounds

You can create a view which doesn’t include name with link menu field. You also have to create a custom permission level to prevent users creating their own views or customizing existing ones.

Another alternative is to create a custom page that will replace the list view so you can manage the view yourself. After you implemented this page you can hide list from the users. This way is more secure way but it needs some programming.

As the title is self-describing, these are workarounds. Since the information is there, always a way to access that infomation can be found.

Hope these help..

Leave a comment

Your email address will not be published.

%d bloggers like this: