Jul 2nd, 2009, 09:21 AM
Capturing UserId in spring webflow
I need to capture/track the userId of the user that is using my application and then i need to use it to see that the user who created a record must not be able to edit the same record. Please guide me as how to do this.
Thanks in advance.
Jul 2nd, 2009, 12:46 PM
Are you referring to a UserId obtained through Spring Security, or some kind of custom user ID? Either way, you should have access to it in SWF. I'm assuming you have a state which allows the user to edit a record, and that you have access to the userId of the user who created the record. You can use an evaluate action to check if the userId of the current user is the same as the userId of the record creator, and prevent that editing state from being reached. It's not really something webflow-specific, it's just some simple if / else logic.