I want set user permission based on Workflow for Doctype Item.
here an example:
When User-1 create a item it can only read/writable to User:-2(reviewer)
after review it will be read/writable to user-3 (approve) and finally , after approved item can read/writable to All others user who has permission for Item.
Mostly no need for script.
Update field enabled/disabled =1 and 0 based on the workflow status of the item.
So make it enabled at the final approval step.
Please refer update field, value in workflow status table.