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>
<td>
<!-- Login -->
</td>
<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.

|| SharePoint 2007 || Web Publishing

comments powered by Disqus

Let's Get In Touch!


Ready to start your next project with us? That’s great! Give us a call or send us an email and we will get back to you as soon as possible!

+1.512.539.0322