Posts

Showing posts from October, 2011

Tutorial: Add Custom List actions using SharePoint Designer 2010

Image
One of the new features of SharePoint 2010 is the ability to easily add Custom Actions buttons to the Ribbon, List item menu and the built-in forms (Display, Edit and New) .  This can be done with SharePoint Designer 2010 and the “Custom Actions” functionality .  In this tutorial I explain how to use this feature to add custom action buttons to various parts of the UI for lists and libraries in SharePoint 2010.

Add Custom Links to the SharePoint 2010 UI as a Feature with or without using Visual Studio

In this article, I demonstrate the process of adding a custom link and group to the UI in SharePoint as a Site Feature without using Visual Studio, as well as using Visual Studio.   In some cases you may not have Visual Studio installed on a Server running SharePoint, or may just want to quickly add a custom link in the interface such as on the Site Settings page, or the Actions or Settings menu for a Document Library or List.  In other cases you may have a project in Visual Studio containing new functionality to be deployed to a SharePoint environment, that needs to be accessed through adding custom links to the UI.  It makes sense to deploy the custom links as part of the solution feature, so I also explain how to achieve this from a Visual Studio Project.

Apply Permissions to Custom UI Links / Actions in SharePoint Menus and Settings Pages

Image
This post explains how to incorporate permissions into custom links and actions added to the UI on menus, toolbars and default layout pages such as the Site Settings page in SharePoint 2010 .     Examples included in the post are: Restricting custom links on list settings pages to only site collection administrators Adding custom actions to the Document Library dropdown menu (ECB - Edit Control Block) that are displayed only to users with edit permissions on the document. Displaying a link on the Site Actions menu only to users with access to manage  permissions for the current site. Displaying a custom link on the List Actions menu for users with access to manage the list. Display a link on the Site Settings page of a site to users with access to add and customise pages on the site, as well as apply themes and stylesheets to the site (Site Designers).

SharePoint Application Page Security

This article covers information relating to security for Application pages and page components in SharePoint: Selecting the correct base class to inherit from when developing Application Pages in SharePoint Securing Application pages with user permissions Specifying when the CheckRights method is called to determine if a user has access to the page. Programmatically check if the user has permission to access the page Code Access Security (CAS) Policy for SharePoint Components

SPBasePermissions Usage With (Programmatic) and Without Code

In this post, I list some of the properties and methods that return a SPBasePermissions enum , and some methods that take SPBasePermissions as a parameter when checking if a user has certain rights on an object in SharePoint.  Later in the post I also explain how the permission masks with SPBasePermissions can be used to customise (show / hide ) content and custom UI actions / links without using code. Programmatic uses of SPBasePermissions to check for or set permissions on various objects in SharePoint The following are some of the more common components in SharePoint that can be used to get or set permissions, or check if certain permissions are effective for a user on the object. Get or set the Base Permissions for a Role Definition in a Web SPWeb.RoleDefinitions.BasePermissions Get the current or specified user’s effective SPBasePermissions on an object (SPWeb, SPList, SPListItem, etc.) Username passed as String to GetUserEffectivePermissions(): SPSite SPSi...

Permission Based Content in SharePoint (With Examples)

The examples in this tutorial demonstrate how to restrict certain content or controls on a page in SharePoint to specific users based on their permissions .  It can be applied to a Master Page, or directly to a .aspx page in SharePoint using SharePoint Designer.  Many options are available to configure exactly how and when the content should be displayed using the base permissions available in SharePoint with the SPSecurityTrimmedControl class. The complete list of base permissions that can be used with the class can be viewed on this page: SPBasePermissions .  It is also possible to show or hide content based on user authentication using the AuthenticationRestrictions property of the class, which may be useful if you want to display a different set of links depending on if a user has been authenticated or is anonymous. Below are some examples of base permissions that are more likely to be used to restrict content to specific users with the associated permi...

SharePoint 2010: Add User Control to Master Page Using SharePoint Designer 2010

Image
In this article I explain the steps to include a custom User Control in a Master Page in SharePoint 2010 using SharePoint Designer .   In my case, the example User Control I am adding to the Master Page in this tutorial is in the following location which would vary depending on the name and of the Control and the folder it is saved in:  “~/_controltemplates/SP2010_UserControl_Example/DynamicSiteTitle.ascx file” SharePoint Designer 2010 Master Page User Control Using SharePoint Designer 2010, open the Site and Master Page Library where the Master Page will be stored containing the User Control.  In this example, I am creating a copy of the default v4.master used in SharePoint 2010 in the root site Master Page Library and calling it v4b.master. Open the Master Page you wish to modify by right clicking the and selecting the “Edit File in Advanced Mode” option. Close to the top of the markup below the existing @Register / @Import tags, add the fol...