1

I have requirement where i need to add security trim on SharePoint list. A new column field called AdminOnly Yes and No. So if item has AdminOnly value mark to Yes then only Admin can see. How i can approach this?.

I am thinking to use something like this:

<SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl1" runat="server"  
AuthenticationRestrictions="AuthenticatedUsersOnly" Permissions="AddListItems" 
PermissionContext="CurrentSite">  



</SharePoint:SPSecurityTrimmedControl>

2 Answers 2

3

The SharePoint:SPSecurityTrimmedControl is a server side ASP.NET control that hides or shows the HTML/page content between the start and the end tags. It has no practical use for lists.

There are two common solutions to your need:

  1. Create a workflow that checks the AdminOnly column and then: breaks inheritance on the list item, and grants permissions to the admin users (SP group).
  2. Create a folder for Admin Only content. break inheritance on the folder and grant permissions to only the admin users. Modify the default view to hide folders (a checkbox on the new/edit view page). Non-admin users would only see the non-admin items while admin users would see a single list of both non-admin and admin items. You would use a send view that does not hide folders to add new content.

The second choice is generally better as there is only one thing with broken inheritance, the folder, there is no extra column to confuse users and there is no workflow to deal with.

0

From your description, you want to achieve that if item has AdminOnly value mark to Yes then only Admin can see the item.

You can create SharePoint 2010 platform workflow and using Impersonation step to modify permission for list items:

enter image description here

Set start workflow automatically when an item is created/changed:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.