Matthew McDermott, MVP

General ramblings from a SharePoint MVP about SharePoint and Microsoft technologies related to collaboration, web content management and productivity.

Hiding 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 where the author was hiding different page elements from anonymous users with the following tag:

<Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="BrowseDirectories">

[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 runat="server" PermissionsString="BrowseDirectories">

<table>

<tr>

<!-- Login -->

<td>

<wssuc:Welcome id="IdWelcome" runat="server" EnableViewState="false"/>

</td>

<td>

<!-- Site Actions Menu -->                                                                            

<PublishingSiteAction:SiteActionMenu runat="server"/>

</td>

</tr>

</table>

</Sharepoint:SPSecurityTrimmedControl>

 

Oh, now you are wondering how you would log in. Just point your browser at a protected page like _layouts/settings.aspx.

Posted by Matthew McDermott on Saturday, 2 Jun 2007 05:09
0 Comments | Filed under: SharePoint 2007, Web Publishing
Bookmark this post with:        

Comments

Leave a comment

Name (required)

Url

Email

Comments

Complete this section to post your comment