Skip to main content

Notifications

Set SharePoint item level permissions (break role inheritance, assign permissions) by Microsoft Flow

This article will show how to use Microsoft Flow to break role inheritance and grant permissions on the list item for the user and for specific SharePoint group.

 

In this case, I'm using a few variant of the â€˜Change Permissions’ action from Plumasail SP connector, which is a part of Plumsail Actions.

 

Before starting, ensure that you added Plumsail SP connector to Microsoft Flow.

 

This example will show a simple case of business traveling system when a user can create a new request on the business travel as the item in SharePoint list (‘Business Travel Requests‘), specify the requester of the business trip the locations of his business trip, the date of departure and the date of return. Once it is done, the flow breaks the permissions inheritance for the new item and grant permissions for the user that was specified as the requester and for â€˜Travel Managers‘ SharePoint group that contains managers who response for business trips.

 

This article is divided to stages:

  • Create SharePoint list
  • Configure Microsoft Flow
 
Create SharePoint list

 

At this stage it was created the new SharePoint list â€˜Business Travel Requests’ with following structure:

  • Requester – "Person or Group" field. The user who requests a business trip.
  • Date of Departure – "Date and Time" field. The date of beginning a business trip.
  • Date of Return - "Date and Time" field. The date of ending a business trip.
  • Location - Text field. The destination of a business trip.

This is how the new form looks like:

 

set-permissions-list-new-item.png

 

Configure Microsoft Flow

 

At this stage was created a flow and configured it to start on list item creation for â€˜Business Travel Requests’ list. You can find more information about specific parameters of the flow actions in the documentation .

 

The complete flow is below:

 

Microsoft Flow

 

As you can see I used â€˜When an item is created’ trigger from â€˜SharePoint’ connector and three â€˜Change Permissions’ actions.

 
When an item is created

 

At this step I specify values for â€˜Site Address’ and â€˜List Name’ fields to bind the flow to the â€˜Business Travel Requests‘ list.

 
Remove all permissions from item

 

It is a â€˜Change Permissions’ action. In this action, I firstly choose â€˜RemoveAll’ value for â€˜Action type’ field and â€˜Item’ value for â€˜Target’ field.

 

Then others fields of the form generated automatically based on my parameters.

 

After that, I specified value of â€˜Item ID‘ field as â€˜ID‘ parameter from â€˜When an item is created‘, â€˜List name’ as the name of my list with business travel requests (‘Business Travel Requests‘) and specify the URL of the site as the value for â€˜SharePoint Site URL‘ field.

 

Grant permissions on item for Requester

 

It is another â€˜Change Permissions’ action for granting permissions on the new item for user that was specified as the requester. In this action, I firstly choose â€˜Grant’ value for â€˜Action type’ field and â€˜Item’ value for â€˜Target’ field.

 

Then others fields of the form generated automatically based on my parameters.

 

After that, I specified value of â€˜Item ID‘ field as â€˜ID‘ parameter from â€˜When an item is created‘, â€˜List name’ as the name of my list with business travel requests (‘Business Travel Requests‘) and specify the URL of the site as the value for â€˜SharePoint Site URL‘ field. Next, I specified â€˜Role type‘field as â€˜Contribute’ and the value of the parameter â€˜Requester Email’ from â€˜When an item is created‘ as the value of â€˜User or group’ field. Also, I specified the URL of the site as the value for â€˜SharePoint Site URL‘ field.

 
Grant permissions on item to "Travel Managers" group

 

It is another â€˜Change Permissions’ action for granting permissions on the new item for â€˜Travel Managers‘ SharePoint group that contains managers who response for business trips.

 

In this action, I firstly choose â€˜Grant’ value for â€˜Action type’ field and â€˜Item’ value for â€˜Target’ field.

 

Then others fields of the form generated automatically based on my parameters.

 

After that, I specified value of â€˜Item ID‘ field as â€˜ID‘ parameter from â€˜When an item is created‘, â€˜List name’ as the name of my list with business travel requests (‘Business Travel Requests‘) and specify the URL of the site as the value for â€˜SharePoint Site URL‘ field. Next, I specified â€˜Role type‘field as â€˜Contribute’ and the name of the group â€˜Travel Managers’*as the value of *‘User or group’ field. Also, I specified the URL of the site as the value for â€˜SharePoint Site URL‘ field.

 

That is all, the flow is configured.

 

This post was orignially published here.

Comments

*This post is locked for comments

  • BVN Profile Picture BVN 26
    Posted at
    Set SharePoint item level permissions (break role inheritance, assign permissions) by Microsoft Flow

    Great Article!

     

    Would this also work for document libraries instead of lists?

    Regards, benedikt

  • Fleur Profile Picture Fleur 30
    Posted at
    Set SharePoint item level permissions (break role inheritance, assign permissions) by Microsoft Flow

    Will this restrict access to the record immediately on save?  or is there a 5 minute delay due to the standard Flow beaviour to check every 5 minutes.