I have an issue tracking list , and I want certain fields to be shown only if the user is inside a group named “Managers”.
So I wrote the following farm solution inside visual studio, which i will add to my Edit form:-
protectedoverridevoidOnInit(EventArgs e){base.OnInit(e);InitializeControl();using(SPSite site =newSPSite(SPContext.Current.Site.Url))using(SPWeb web = site.OpenWeb()){SPGroupgroup= web.Groups["Managers"];bool isUser = web.IsCurrentUserMemberOfGroup(group.ID);if(isUser){//what should I write here}}}
But I am not sure how I will be hiding the columns in my if statement ? can anyone advice how can i reference specific site column in my above code ?
Thanks