Verbergen van ribbon in Sharepoint 2010

In Sharepoint 2010 is de handige ribbon aanwezig om acties te kunnen voltooien op de website. Voor de publieke website die ik momenteel aan het ontwikkelen ben is het niet nodig dat anonieme gebruikers deze ribbon krijgen te zien. Het past immers niet echt in de stijl van de website, anonieme gebruikers kunnen er niets mee, waardoor het alleen maar afleidt.

Gelukkig is er tegenwoordig een oplossing voor die out of the box kan worden gebruikt, namelijk het volgende stukje code:

<Sharepoint:SPSecurityTrimmedControl runat="server" Permissions="ManageLists">
    Put	Your Control Here
<SharePoint:SPSecurityTrimmedControl>

Uiteraard kan deze code voor veel meer dingen worden gebruikt dan alleen de ribbon. Zoals altijd, gebruik dit met mate!

Mogelijke waarden die kunnen worden gebruikt bij het attribuut Permissions zijn te vinden op deze MSDN pagina.

Voor de volledigheid, hier ook het overzicht dat momenteel op de pagina staat:

Member nameDescription
EmptyMaskAvailable in SharePoint Online Has no permissions on the Web site. Not available through the user interface.
ViewListItemsAvailable in SharePoint Online View items in lists, documents in document libraries, and view Web discussion comments.
AddListItemsAvailable in SharePoint Online Add items to lists, add documents to document libraries, and add Web discussion comments.
EditListItemsAvailable in SharePoint Online Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries.
DeleteListItemsAvailable in SharePoint Online Delete items from a list, documents from a document library, and Web discussion comments in documents.
ApproveItemsAvailable in SharePoint Online Approve a minor version of a list item or document.
OpenItemsAvailable in SharePoint Online View the source of documents with server-side file handlers.
ViewVersionsAvailable in SharePoint Online View past versions of a list item or document.
DeleteVersionsAvailable in SharePoint Online Delete past versions of a list item or document.
CancelCheckoutAvailable in SharePoint Online Discard or check in a document which is checked out to another user.
ManagePersonalViewsAvailable in SharePoint Online Create, change, and delete personal views of lists.
ManageListsAvailable in SharePoint Online Create and delete lists, add or remove columns in a list, and add or remove public views of a list.
ViewFormPagesAvailable in SharePoint Online View forms, views, and application pages, and enumerate lists.
OpenAvailable in SharePoint Online Allow users to open a Web site, list, or folder to access items inside that container.
ViewPagesAvailable in SharePoint Online View pages in a Web site.
AddAndCustomizePagesAvailable in SharePoint Online Add, change, or delete HTML pages or Web Part Pages, and edit the Web site using a SharePoint Foundation compatible editor.
ApplyThemeAndBorderAvailable in SharePoint Online Apply a theme or borders to the entire Web site.
ApplyStyleSheetsAvailable in SharePoint Online Apply a style sheet (.css file) to the Web site.
ViewUsageDataAvailable in SharePoint Online View reports on Web site usage.
CreateSSCSiteAvailable in SharePoint Online Create a Web site using Self-Service Site Creation.
ManageSubwebsAvailable in SharePoint Online Create subsites such as team sites, Meeting Workspace sites, and Document Workspace sites.
CreateGroupsAvailable in SharePoint Online Create a group of users that can be used anywhere within the site collection.
ManagePermissionsAvailable in SharePoint Online Create and change permission levels on the Web site and assign permissions to users and groups.
BrowseDirectoriesAvailable in SharePoint Online Enumerate files and folders in a Web site using Microsoft Office SharePoint Designer 2007 and WebDAV interfaces.
BrowseUserInfoAvailable in SharePoint Online View information about users of the Web site.
AddDelPrivateWebPartsAvailable in SharePoint Online Add or remove personal Web Parts on a Web Part Page.
UpdatePersonalWebPartsAvailable in SharePoint Online Update Web Parts to display personalized information.
ManageWebAvailable in SharePoint Online Grant the ability to perform all administration tasks for the Web site as well as manage content. Activate, deactivate, or edit properties of Web site scoped Features through the object model or through the user interface (UI). When granted on the root Web site of a site collection, activate, deactivate, or edit properties of site collection scoped Features through the object model. To browse to the Site Collection Features page and activate or deactivate site collection scoped Features through the UI, you must be a site collection administrator.
UseClientIntegrationAvailable in SharePoint Online Use features that launch client applications; otherwise, users must work on documents locally and upload changes.
UseRemoteAPIsAvailable in SharePoint Online Use SOAP, WebDAV, or Microsoft Office SharePoint Designer 2007 interfaces to access the Web site.
ManageAlertsAvailable in SharePoint Online Manage alerts for all users of the Web site.
CreateAlertsAvailable in SharePoint Online Create e-mail alerts.
EditMyUserInfoAvailable in SharePoint Online Allows a user to change his or her user information, such as adding a picture.
EnumeratePermissionsAvailable in SharePoint Online Enumerate permissions on the Web site, list, folder, document, or list item.
FullMaskAvailable in SharePoint Online Has all permissions on the Web site. Not available through the user interface.

Share