martes, 24 de enero de 2012

Control SPSecurityTrimmedControl

Este control permite ocultar el contenido debido a una determinada definición de seguridad.  La solución anterior ocultaba en el lado del cliente (style.display='none') el contenido, ahora lo hace desde el servidor.

<SharePoint:SPSecurityTrimmedControl PermissionsString="AddAndCustomizePages, ManageLists" runat="server">
    <%--content %>
</SharePoint:SPSecurityTrimmedControl>

 

Oculto la ribbon:

Useful attributes of the control:

  • PermissionContext - against which user permissions will be tested

(possible values: CurrentSite, CurrentList, CurrentFolder, CurrentItem or RootSite)

  • PemissionMode - does the user have to meet all role definitions or just one of them

(possible values: All or Any)

  • PermissionsString - what permissions does the user need to see the content - can enter some values separated by comma

(possible values are from the enumeration SPBasePermissions:

EmptyMask,ViewListItems,AddListItems,EditListItems,DeleteListItems,ApproveItems,OpenItems,ViewVersions,

DeleteVersions,CancelCheckout,ManagePersonalViews,ManageLists,ViewFormPages,Open,ViewPages,

AddAndCustomizePages, ApplyThemeAndBorder,ApplyStyleSheets,ViewUsageData,CreateSSCSite,

ManageSubwebs,CreateGroups, ManagePermissions,BrowseDirectories,BrowseUserInfo,AddDelPrivateWebParts,

UpdatePersonalWebParts,ManageWeb, UseClientIntegration,UseRemoteAPIs,ManageAlerts,CreateAlerts,

EditMyUserInfo,EnumeratePermissions,FullMask)

  • AuthenticationRestrictions - allows to differ between authenticated and anonymous users

(possible values: AllUsers, AuthenticatedUsersOnly, AnonymousUsersOnly)

save, check-in, publish and there you go!

 

Fuente:

http://msdn.microsoft.com/en-us/library/ms476454.aspx

Más información:

SharePoint Anonymouse Access Web Part Targeting http://www.richardawilson.com/2010/04/sharepoitn-anonymouse-access-web-part.html

No hay comentarios:

Publicar un comentario