Giving Access to Share point Document Library using Azure Logic app.

Md Sadiq Imam 20 Reputation points
2024-01-16T10:57:59.93+00:00

Hello Team, I have gone through a few articles in search of the above solution and found that there is a share point connector in the logic app "Grant access to items and folder ".It requires some mandatory fields like site address, library ID (a unique identifier for items and folders), etc. My question is, "Is there any way to skip the ID mandatory field in the SharePoint connector? I want to give SharePoint access only at the document library level rather than the folder level.

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,348 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,213 questions
0 comments No comments
{count} votes

Accepted answer
  1. Sonny Gillissen 3,361 Reputation points
    2024-01-17T20:10:08.1133333+00:00

    Hi Md Sadiq Imam, Thank you for reaching out on Microsoft Q&A! I've addressed the kinda the same issue before in another topic, which was around specific items. However, if you remove the /items({itemId}) from the URL's you could do the exact same for the library itself. Below I've changed the URL's, so please don't pay attention to the URL's in the screenshots but use the URL's noted below them.

    This can be achieved by the "Send an HTTP request to SharePoint" indeed, as there are no default actions available within the SharePoint Connector as of yet. Basically, to execute your desired process its three steps to be performed in order:

    • First you need to reset role inheritance, where you reset all custom permissions sets back to it's inherited state:
      User's image

    URL:
    _api/lists/getById('{listId}')/resetroleinheritance

    • Next you need to break role inheritance, as this is reset by the previous action where you made sure the rights were the same. This can be done as follows:

    User's image **
    URL:**
    _api/lists/getById('{listId}')/breakroleinheritance(copyRoleAssignments=false,clearSubscopes=true)
    **
    Note:** the "copyRoleAssignments=false" makes sure the current roles set will not be copied to the folder and all subsequent files. This basically clears all permissions. With "clearSubscopes=true" you make sure all subsequent files will follow the new permission set from the parent

    • After that you can add new user ID's with their respective permissions back to the folder. Please find the table below for the default role assignments and their ID's. You do this with the step below:

    User's image URL:
    _api/web/lists/getById('{listId}')/roleassignments/addroleassignment(principalid={userId},roledefid={roleDefinitionId}) Please be sure to update {listId}, {userId} and {roleDefinitionId} to the respective ID's from your flow to match your situation. For the role definitions, at least the defaulf ones, you can use the table below: || || |Full Control|1073741829| |Design|1073741828| |Edit|1073741830| |Contribute|1073741827| |Read|1073741826| |View Only|1073741924| |Limited Access|1073741825|

    Please click “Accept answer” if you find this helpful. Feel free to drop additional queries in the comments below! Kind regards, Sonny

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.