To start with here is my scenario. I have a document library which all users have read-only access to. There are a few trusted people who can upload items to it. A small percentage of the items uploaded should only be able to be seen by a certain group.
To achieve this I have created a workflow that checks the value of a sensitivity field that the uploader will set. If it is of a "sensitive" value, the workflow breaks the permissions of the item and sets it so that only the single group can view the item.
In terms of functionality, I have achieved what I wanted. I am however having the same problems I have had with event receivers in the past (and never really got to the bottom of).
When uploading a document in SharePoint, it seems to happen in two parts. You select the file and click upload. At this point the document is uploaded and THEN the edit properties dialog is displayed.
The "new" event seems to be triggered after the upload button is clicked but BEFORE the save button is pressed on the edit properties dialog shown after.
My workflow is set to fire both when a new document is created, and when a document is changed.
The problem is that on the "new" event, the sensitivity value has not yet been populated so the permissions will not be changed appropriately. And the "change" event is not fired when the properties are entered and saved on the initial upload (they are for future changes).
Will workflows never fire on the initial save of properties after uploading a document? And if this is the case, how do people get around wanting to process something on a new item?
Thanks for your time