Select to view content in your preferred language

Controlling who can edit a particular feature

738
0
05-03-2011 05:34 AM
CaseyBentz
Frequent Contributor
I would like to set up a control mechanism that will only allow the user who created a feature to edit it.  I have the creation user stored in the feature class and I send over the creation user when a new feature is created.  I had tried setting these properties:

deleteEnabled="{Model.instance.userName == dg.selectedItem.info.CREATIONUSER}"
updateAttributesEnabled="{Model.instance.userName == dg.selectedItem.info.CREATIONUSER}"


updateGeometryEnabled="{Model.instance.userName == dg.selectedItem.info.CREATIONUSER}"

But this did not work because it appeared that the feature geometry was being created prior to the attribute of CREATIONUSER being set.  What would happen is, I would draw the polygon and it would pop up the attribute editor window but I could not edit it because I believe the CREATIONUSER was not set when the attribute window opened.  If I close the window and open it again, I can then edit the attributes.  And this only happened some of the time.  Sometimes it worked as I expected it to. 

I have tried playing with the editsStarting event on the feature layer, and I can prevent the edit from being sent over, but I cannot get the attributes in the inspector to set back to the original value. 

If anyone has had success with controlling when an edit is allowed, I would greatly appreciate any help.
Tags (2)
0 Kudos
0 Replies