Posts

Showing posts from 2014

Site Management Workflow Activities - Sample Solution Now Available

Earlier this year, I published a series of blog posts on custom workflow activities for SharePoint 2013 and Office 365. Among other things, I covered how to build workflow activities to:

Create sites.Set site permissions and list permissions.Create groups and set group owners.Break permissions inheritance.Set the associated owners, members and visitors groups on a site. Since then, several people have asked me to make my source solution available - so here it is:
Download SiteManagementActivities.zip
Disclaimers: It's proof-of-concept code, not production-ready code. For use as a learning aid in a test environment only.Please read the corresponding blog posts before you play around with the custom activities - they'll make much more sense once you've read the explanations. To build and test the solution, you'll need a test environment with a local SharePoint 2013 installation, SharePoint Designer 2013, and Visual Studio 2012 with Office Developer Tools or Visual Studio 20…

Can't find Business Data Web Parts? Check your permissions.

Image
Just a quick note on an issue we encountered today. Users with the Contribute permission level can, as you'd expect, edit wiki pages in SharePoint 2013. As part of the editing process, users can add various web parts to the wiki page. Today we were temporarily stumped when a user with Contribute permissions wanted to add a Visio Web Access web part to a wiki page. It turns out that this web part, along with most business data web parts, is only available when the user has the Add and Customize Pages permission (found in the Design permission level).

With the Contribute permission level, the insert web part options looked like this:



















Whereas with the Design permission level, the insert web part options looked like this:
















Conclusion - if your users are struggling to add business data web parts to wiki pages, it might be a permissions issue.

Server-side activities have been updated

Image
If you use SharePoint Designer 2013 to build workflows, there's a fair chance you'll have come across the following error message:
Server-side activities have been updated. You need to restart SharePoint Designer to use the updated version of activities.  Needless to say, restarting SharePoint Designer rarely makes the error go away. The usual advice is:

Approach 1: Clear the cache folders
See for example How to Clear Your SharePoint Designer 2010/2013 Cache. If you've just deployed some custom workflow activities to your site, this will probably solve your problem (and you should clear the cache folders every time you deploy custom activities). If the error occurs spontaneously, this approach often won't help.

Approach 2: Reinstall SharePoint Designer
This might work if you've got a preview version of SharePoint Designer installed. If not, it's unlikely to help. It didn't work for me, and it didn't work for countless others on the forums.

Approach 3: Insta…

Custom Workflow Activity for Granting Permissions on a SharePoint List

Image
In this post I'll show you how to build a custom workflow activity in Visual Studio 2012 that grants permissions on a SharePoint 2013 list or library to a user or group.

Note: this is part of a series of posts on building workflow activities to manage sites, groups, users and permissions. For a complete list of posts, together with a more detailed walkthrough of how to build a custom workflow activity and make it available in SharePoint Designer, start at the beginning.


Fundamentals You can use the REST API to set permissions on any securable object in SharePoint 2013. However, the object on which you're trying to set permissions must not inherit permissions from a parent object. In the case of lists and libraries, this typically means that you must break permission inheritance before you attempt to set permissions. I described how to create a workflow activity that breaks permission inheritance in a previous post.

Once you've broken any permission inheritance, you grant pe…

Custom Workflow Activity for Breaking List Role Inheritance

Image
In this post I'll show you how to build a custom workflow activity in Visual Studio 2012 that breaks role inheritance on a SharePoint 2013 list or library.

Note: this is part of a series of posts on building workflow activities to manage sites, groups, users and permissions. For a complete list of posts, together with a more detailed walkthrough of how to build a custom workflow activity and make it available in SharePoint Designer, start at the beginning.
Fundamentals This is nice and straightforward. You can use the REST API to break role inheritance on a SharePoint list or library. You need to send a web request that resembles the following:

Endpoint:
{site collection URL}/_api/web/lists/getByTitle('{List title}')/breakroleinheritance(copyRoleAssignments={true/false}, clearSubscopes={true/false})
HTTP method:
POST
You can leave the request body empty, and you don't need to add any request headers if you're doing this from a workflow activity. (If you're doing i…

Custom Workflow Activity for Granting Permissions on a SharePoint Site

Image
In this post I'll take a look at how to build a custom workflow activity in Visual Studio 2012 that grants permissions on a SharePoint 2013 site to a user or group.

Note: this is part of a series of posts on building workflow activities to manage sites, groups, users and permissions. For a complete list of posts, together with a more detailed walkthrough of how to build a custom workflow activity and make it available in SharePoint Designer, start at the beginning.


Fundamentals You can use the REST API to grant permissions to a SharePoint principal (i.e. a user or group). There are two stages to the process.

Stage 1: Get the Role Definition ID
Before you can grant permissions to a principal, you need to know the ID of the role definition (i.e. the permission level) you want to assign to the principal. Built-in role definitions have a ten-digit ID value. For example:
The ID of the Full Control role definition is 1073741829.The ID of the Contribute role definition is 1073741827.The ID…

Custom Workflow Activity for Setting the Associated Members Group of a SharePoint Site

Image
So far in this series of posts I've looked at building custom workflow activities in Visual Studio 2012 to create sites, create groups, and set group owners in SharePoint 2013. In this post I'll walk you through how to build a workflow activity that sets the associated members group of a SharePoint site. You can use the same approach to set the associated owners group and the associated visitors group as required.

Note: this is part of a series of posts on building workflow activities to manage sites, groups, users and permissions. For a complete list of posts, together with a more detailed walkthrough of how to build a custom workflow activity and make it available in SharePoint Designer, start at the beginning.

Fundamentals You can't currently use the REST API to set the associated groups for a SharePoint site. The REST API includes endpoints for each property:
/_api/web/associatedownergroup/ _api/web/associatedmembergroup/_api/web/associatedownergroup However, although th…

Custom Workflow Activity for Setting a SharePoint Group Owner

Image
In my last couple of posts I've looked at building custom workflow activities in Visual Studio 2012 to create sites and create groups in SharePoint 2013. In this post I'll walk you through how to build a workflow activity that changes the owner of a SharePoint group. This is slightly more challenging, as at the time of writing you cannot use the REST API to change the owner of a SharePoint group. Instead, you have to make a service call containing client-side object model (CSOM) XML. If I ever make it to San Diego, I owe Chris Givens several drinks for helping me figure out this approach and switching me on to the capabilities of CSOM XML.

Note: this is part of a series of posts on building workflow activities to manage sites, groups, users and permissions. For a complete list of posts, together with a more detailed walkthrough of how to build a custom workflow activity and make it available in SharePoint Designer, start at the beginning.


Fundamentals You can't currently us…