I am trying to implement item level security in my application and i
have run into an issue wherein i wish to hide a few of the controls in
my grid view. Below are the complete details of my scenario,
I have list named as States which contains the following data
- Washington - Item Permissions assigned - Adam has Write permissions
- New York - Item Permissions assigned - Charles has Read permissions
- Texas - No Permissions assigned to both the users
According the SharePoint object model when i try to fetch all the
records, i get the data as per my requirement i.e. Adam is only able to
view Washington and Charles is only able to view New York.
Now this data is shown in the gridview which has view,edit buttons against it.
i wish to trim these buttons according to the permissions of the user
on the list items. Kindly let me know if there is a way to do it.
I was curious to know whether anyone has knowledge of what does SPSecurityTrimmedControl.PermissionContext
property do? Does it apply security triming based on the current list
item permission, if so how does it do it. please provide a sample