Is it possible to "softlock" a SPListItem so that a user can't edit it but a workflow he had started can do it?
Background:
- ListItems should only be editable by users when no workflow is running
- Workflows should only be startable by users when no other workflows are running
- Workflows may change ListItems
- Users have to be notified why they can't start a workflow or edit an item anymore (not via Email)
My first idea was to set read-permissions for everyone for that item, so that they can't edit and start other workflows as long one is running, but the customer wants some kind of information for his users (like an error message but not an email). Since SPD Workflows are being used I am not able to show an error message or somehting. So what i did was implementing two event receivers. One firing when an workflow is starting (checking an invisible column 'ActiveWorkflow', showing up an error when the column has a value other than 0, which is set by workflows) and the second event fires when an item is updating (to prevent and abort changes that users make when a workflow is running). My problem with this approach is that i can't differentiate between user edits and workflow edits in the ItemUpdating event, thus blocking my own workflow.
Another idea that came to my mind was designing the whole workflow in an impersonation step and check the current user in the ItemUpdating Event (should be the account which published the workflow if the item was changed by workflow) but I don't really like this solution because all changes to this item will be made by this user (fields like modified by, etc) as far as I know and I need to change existing workflows in their structure, since the things I listed in the background are change-requests for existing, complex workflows and I want to change as less as possible because they are working as intended.