Click to Rate and Give Feedback

  Switch on low bandwidth view
Community Content
In this section
Statistics Annotations (2)
SPSecurityTrimmedControl Class (Microsoft.SharePoint.WebControls)
Conditionally renders the contents of the control to the current user only if the current user has permissions defined in the PermissionString.

Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Visual Basic (Declaration)
<ParseChildrenAttribute(False)> _
<DesignerAttribute(GetType(SPControlDesigner))> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel:=True)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level:=AspNetHostingPermissionLevel.Minimal)> _
Public Class SPSecurityTrimmedControl
    Inherits WebControl
    Implements IDesignerEventAccessor
Visual Basic (Usage)
Dim instance As SPSecurityTrimmedControl
C#
[ParseChildrenAttribute(false)] 
[DesignerAttribute(typeof(SPControlDesigner))] 
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
public class SPSecurityTrimmedControl : WebControl, IDesignerEventAccessor

Allows the conditional display of content depending on the user’s permission. The content can be any HTML code or other controls. One use of the SPSecurityTrimmedControl is to hide the Site Actions menu and the Publishing Console from anonymous users:

<SharePoint:SPSecurityTrimmedControl ID=”SPSecurityTrimmedControl1″
  PermissionsString=”BrowseDirectories” runat=”server”>
    <PublishingSiteAction:SiteActionMenu runat=”server” />
    <wssuc:Welcome id=”explitLogout” runat=”server” />
    <PublishingWebControls:AuthoringContainer ID=”authoringcontrols”
    runat=”server”>
        <PublishingConsole:Console runat=”server” />
    </PublishingWebControls:AuthoringContainer>
</SharePoint:SPSecurityTrimmedControl>
System.Object
   System.Web.UI.Control
     System.Web.UI.WebControls.WebControl
      Microsoft.SharePoint.WebControls.SPSecurityTrimmedControl
         Microsoft.SharePoint.WebControls.SPLinkButton
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
SPSecurityTrimmedControl and annonymous access      Reza Alirezaei - MVP ... Thomas Lee   |   Edit   |   Show History

You can use SPSecurityTrimmedControl to target content to annon users in a FBA site. For more information see: http://blogs.devhorizon.com/reza/?p=508



Reza Alirezaei , MVP
Blog: http://blogs.devhorizon.com/reza

Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker