MVVM/ViewModels and handling Authorization
Posted
by vdh_ant
on Stack Overflow
See other posts from Stack Overflow
or by vdh_ant
Published on 2010-02-14T22:08:03Z
Indexed on
2010/04/02
5:03 UTC
Read the original article
Hit count: 626
Hey guys
Just wondering how how people handle Authorization when using MVVM and/or View Models.
If I wasn't using VM's I would be passing back the Model and it would have a property which I could check if a user can edit a given object/property but when using MVVM I am disconnecting myself from the business object... and thus doen't know what the security should be any more.
Is this a case where the mapper should be aware of the Authorization that is in place and don't copy across the data if the Authorization check fails. If this was the case I am guessing that the mapper would have to see some properties on the VM to let the interface know which fields are missing data because of the Authorization failure.
If this does occur within the mapper, how does this fit in with things like AutoMapper, etc.
Cheers Anthony
© Stack Overflow or respective owner