How to restrict editing based off user role and work order status

@MultiTech_Visions
Matt, maybe you can help with this?

I want to allow clients to make ALL_CHANGES to their Work Orders while in “Pending” [Status]. I want them to be able to update the [Status] to “Working”, but then be restricted to READ_ONLY. Once we update the Work Orders[Status] to “Completed”, I want them to be able to do what they have to do and only be able to edit the Work Orders[Status] to “Archived”.

I also want to allow my staff to be able to update the Work Orders[Status] at every stage, in case a client wants us to handle all that. I want my staff to be able to update only columns specific to our tasks such as quantities and methods, but not any of the input from the client such as SKU’s, titles, Work Order Numbers, Purchase Order Numbers, … etc.

Right now, I have the following in the Editable_If expression for column Status:

OR(TEXT(Users[User_Role])=“Admin”,TEXT(Users[User_Role])=“Manager”,TEXT(Users[User_Role])=“Supervisor”)

This is pretty close, allowing only my staff to make changes to the status, but I would like to make it more complex as detailed above.

Help?

1 2 433
2 REPLIES 2

@rmsmeltz

  • The table update-permissions formula space doesn’t have the granularity to reach the record level;
    • for that you need to implement things on the action-side of things (add/edit/delete actions).

You’re on the right track with the Editable If formula on the columns you want to restrict, just need to tweak the formula you’re using.


A few examples from the video

INDEX(Current_User[User_Role], 1)

in(INDEX(Current_User[User_Role], 1), list("Admin", "Dev", "User"))

SWITCH(INDEX(Current_User[User_Role], 1), 
  "Admin", "ALL_CHANGES", 
  "User", "UPDATES_ONLY", 
"READ_ONLY")
AND(
  IN(INDEX(Current_User[User_Role], 1), LIST("Admin", "Dev", "User")), 
  [Milestone_Status] <> "Complete"
)

Here’s a great breakdown for why your original formula wouldn’t have worked:

Top Labels in this Space