Matthew McDermott, MVP

All MindsharpBlogs

My Links

Post Categories

Article Categories

Archives

Blog Stats

Play

Work

Hiding Authoring Controls from Anonymous Users

I have been working on our latest initiative this weekend, MOSS Connect. As I was plowing through issues I ran across an article by DLC where the author was hiding different page elements from anonymous users with the following tag (Change the ! to the appropriate open or close tag, I cannot get them to render here):

!Sharepoint:SPSecurityTrimmedControl PermissionsString="BrowseDirectories" runat="server"!
[content to be rights-trimmed]
!/Sharepoint:SPSecurityTrimmedControl!

It occurred to me that I could hide Welcome and Site Action menu from anonymous users in the same way. This is how I did it on MOSS Connect:

!Sharepoint:SPSecurityTrimmedControl PermissionsString="BrowseDirectories" runat="server"!
!TABLE!
!TBODY! !TR!
!!-- Login --!
!TD!
!wssuc:Welcome id=IdWelcome runat="server" EnableViewState="false"!!/wssuc:Welcome!
!/TD!
!TD!
!!-- Site Actions Menu --!
!PublishingSiteAction:SiteActionMenu runat="server"!!/PublishingSiteAction:SiteActionMenu!
!/TD!!TR!!/TR!
!/TBODY!!/TABLE!
!/Sharepoint:SPSecurityTrimmedControl!

Oh, now you are wondering how you would log in. We use AAM so the authoring web uses NTLM (or Kerberos), if you are using the same URL for authoring simply point your browser at a protected page like _layouts/settings.aspx.

posted on Saturday, June 02, 2007 8:58 AM