0

I have a group of users with edit without delete permission. And I am creating an approval workflow that allows these users to request for the deletion of files. The flow starts well once the admin accepts the request it throughs error on Delete file action (Access denied. You do not have permission to perform this action or access this resource. clientRequestId:)

enter image description here

6
  • Is it Power-automate workflow? If so, check the SharePoint connection used in the workflow. The user account used to connect to SharePoint should have delete file permission. – Matiur Rahman Oct 5 '20 at 3:27
  • @MatiurRahman Yes, it is a power automate workflow. The user has edit without delete permission. But the user just submits a request for deleting a file through an instant workflow. Is not it possible to use the approval account for the deletion action? – Fatimah Mohmmed Oct 5 '20 at 3:57
  • How the Workflow gets triggered? On Delete of the file or On Change of the File Meta Data? – Matiur Rahman Oct 5 '20 at 12:12
  • the user selects a file and sends it as a request for deletion approval (select a file> automate> choose the deletion flow). So, the trigger starts with (For a file selected) – Fatimah Mohmmed Oct 6 '20 at 5:13
  • @MatiurRahman I updated my question and added an image of the workflow, please check. – Fatimah Mohmmed Oct 6 '20 at 5:39
0

In the delete file action, the connection you choose should have enough permission in the site collection. Please check.

3
  • Yes, you are right, To perform the deletion action, the user must have deletion permission. But I want the approval of the workflow (which has deletion permission) to do the action of deletion inside the flow instead of the requester. – Fatimah Mohmmed Oct 14 '20 at 8:02
  • Have you checked the connection for the delete file action? – Emily Du - MSFT Oct 15 '20 at 8:48
  • Yes, I have checked the connection for SharePoint, I added (run only users) I changed it to my connection credential and it worked like a Charm. – Fatimah Mohmmed Oct 15 '20 at 9:56
0

I couldn't reproduce your scenario. But the following scenario worked for me.

SharePoint

  1. The SharePoint Doc Library has a column named [Status] with choices: Approve, Complete, and Delete. The users, who don't have permission to delete documents from this library, will submit a deletion request by changing the status of the document to "Delete"
  2. A MS Flow/Power Automate, When an item is created or modified, will starts since status being modified
  3. Within the flow, if the condition is met, the request is sent to the approver defined in the Flow, and will act on the request (Approve or Reject). If approved, document is deleted from the library using "Delete file" action in the Flow.

MS Flow/Power Automate

The Flow uses a SharePoint Connection with a user account that has permission to delete documents from the library.


Screenshots showing actions that worked

enter image description here

In my case, the approver user doesn't have document Delete permission But the SharePoint connector user does have Delete permission enter image description here

6
  • This is the problem, I gave the user (edit without delete) permission. But I want them to perform a deletion action through the workflow. Is there a way users can gain access to delete using the workflow? – Fatimah Mohmmed Oct 7 '20 at 5:33
  • "Delete file" action in the Flow is controlled by the SharePoint Connector in your flow. That is, when Flows run, the user defined in the SharePoint Connection will perform the deletion. If the connector user has permission to delete file then it will succeed, if not, it will fail. How are you envisioning user deleting files from the Flow? Can you give an example? – Matiur Rahman Oct 7 '20 at 12:29
  • As I mentioned before that users have (edit without delete) permission. When they request for deletion the manager will approve/reject. If he approved the file will be deleted (the deletion action should be performed with the approver account in SharePoint). – Fatimah Mohmmed Oct 13 '20 at 6:25
  • Does your error message show any user account that is not allowed to delete files? I'm using a different trigger, but will see if I can reproduce it with [For a select file} trigger – Matiur Rahman Oct 13 '20 at 12:09
  • Yes, the error shows the user id requester, that his not authorized to perform the action. – Fatimah Mohmmed Oct 14 '20 at 7:56
0

I've tested exactly how your workflow is designed. However, couldn't reproduce the error. The only question now I have is how your flow is being triggered? I've added a column and added JSON format string to trigger the flow. Could you describe how are you triggering the flow?

JSON used to trigger "For a selected file"

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
  "elmType": "button",
  "txtContent": "Request Deletion",
  "customRowAction": {
    "action": "executeFlow",
    "actionParams": "{\"id\": \"0e7a1b3f-c4e6-4840-bfe5-e80b1c283e2e\"}"
  }
}

enter image description here

SharePoint/Flow User Conditions

  1. The users requesting deletion doesn't have Delete permission, but has Edit permission
  2. The users approving the deletion doesn't have Delete permission
  3. The flow is running with the Owner account, that is, who developed the Flow This Flow Owner has Full Control permission to the library

Screenshot showing the deletion success enter image description here

2
  • My flow triggered when the user selects a file then click on Automate> select the deletion flow. The flow I have created is similar to yours, except for starting the trigger. I am so surprised how it works for you where the requester is not having deletion permission? – Fatimah Mohmmed Oct 15 '20 at 5:39
  • I solved the problem by changing the run only users to my connection, I like your idea of adding the button rather than trigger by automating option. – Fatimah Mohmmed Oct 15 '20 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.