Sharepoint - Hiding some fields from some groups
I would like to ask , How can I hide some columns (ex. price,client's Mobile etc...)from group (such as Home visitors )?
Note: I'm using s开发者_开发百科harepoint 2010 foundation.
SharePoint 2010 doesn't have field level security, so you can't totally prevent different groups from seeing that data.
What you could do is create different forms/views for the different groups, and then only give them links to those form/view pages depending on the groups. However, if they know the right URL, they'd be able to type that in and see the other views.
I do not know of anything in the Enterprise version that adds field level audiences, security, or trimming. We recently completed a project that had "For Admin use only" fields. As Andy described, we used multiple forms to accomplish this. The only difference is that we protected against URL spoofing by having the Admin forms inherit from a custom class that checked the identity of the user:
public class AdminEditFormPage : WebPartPage
{
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
CheckRights();
}
private void CheckRights()
{
SPWeb web = SPContext.Current.Web;
SPGroup group = web.SiteGroups[Groups.FarmAdministrators];
bool flag = (group != null) && group.ContainsCurrentUser;
if (!flag)
{
SPUtility.HandleAccessDenied(new UnauthorizedAccessException());
}
}
}
精彩评论