We have the following scenario: -
1) We have a SharePoint list named WorkOrders (WO), where all users have read-only permission on it, while only operation managers can edit/create items inside it
2) But we want the technician user to be able to close his own work order/s when they complete them. but if they directly update the WO status to "Closed" using their username from the Power Apps, they will get a permission error.
3) So, we implemented this scenario to have an elevated permission settings to be able to update the WO status by the technician, as follow: -
3.1) We created a power automate flow, that get called from Power Apps using the (Power Apps V2), where the flow gets the WorkOrderID as a parameter, then inside the flow we get the WO, check if the WorkOrderStatus = Assigned, then check if the user who called the flow (triggerOutputs()['headers']['x-ms-user-email']) = the work order technician
3.2) If so then we are fine to have the technician closing the work order
3.3) Here is the formula inside Power Apps that calls the flow:-
UpdateContext({Status: 'CloseWorkOrder(Elevated)'.Run(varWorkOrder.ID).status});
3.4) and we define the power automate flow to run as elevated privileges, by defining the service account inside the Run-Only user permission for the SharePoint connection, instead of the Run-only user option as follow: -
Here is the power automate flow related steps, where we are getting the WO, check if the WO technician is the same as the user who called the flow using the (triggerOutputs()['headers']['x-ms-user-email']) property, if so to update the WO status to "Closed":-
so based on the above i have those questions:-
1) From a security perspective, can a user who use the Power Apps modify the parameters passed from Power Apps to Power Automate? either the explicit parameter which is the WorkOrderID (WOID), or the implicit parameters such as the "triggerOutputs()['headers']['x-ms-user-email']"?? using browser developer tools for example?
2) Is my approach of doing the check inside the workflow, to check if the WorkOrderStatus = Assigned and the WorkOrder technician = the user who called the flow, before closing it ,, a robust approach? and does it mimic doing server-side validation?
Thanks