0

I am making a visual webpart in SP2010, and I want to use this below to only show content if the current user has edit rights to the current page:

<SharePoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl1" PermissionsString="AddAndCustomizePages" runat="server"> 
</SharePoint:SPSecurityTrimmedControl>

Does anyone know if this is the permissionsString I need, or do I need another?

Thanks.

4

Here is a link to all possible values: http://msdn.microsoft.com/EN-US/library/ms412690

In your case you should use EditListItem or AddAndCustomizePages depending on type of page and more exact scenario.

The MSDN above has the full definitions for the two options.

If not one specific is doing it for you, you can combine multiple ones by separating them with " ,"

4
  • The link you gave doesn't seem to have EditPage. What is the difference between EditPage and AddAndCustomizePages.
    – omega
    Jul 15 '13 at 18:46
  • Sorry, I meant EditListItem. Which is more appropriate if you have Publishing Pages. or Webpart pages that are stored in a document library Jul 15 '13 at 18:52
  • In my case, the pages are stored in a pages library, which I believe is the document library. And the pages have a check in, check out, publish options, so then the EditListItem would be the one to use?
    – omega
    Jul 15 '13 at 19:00
  • I am honestly not 100% sure, why not give it a shot? It can not take many minutes to try it out Jul 15 '13 at 19:01
-1

Tested and working

<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="FullMask">
    <div>
        Test text
    </div>
</SharePoint:SPSecurityTrimmedControl>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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