conditional field rendering from server roles

0 views
Skip to first unread message

Sean Chambers

unread,
Nov 19, 2009, 6:36:34 PM11/19/09
to Spark View Engine Dev
I am trying to determine if there is a clever way of doing this rather
than having one view for every role.

In my domain specific roles can only view/edit specific fields on the
spark view. Ie. a Customer role cannot edit the "Customer Credit"
field and see it as readonly. At the same time, certain fields
shouldn't be rendered at all for the Customer role. Even further in,
certain tags are displayed as different text depending on the role.

My first thought was to have a view with all the fields on it and pass
json data to the client to enable/disable/hide/rename fields depending
on the server side data but this has other difficulties.

My second thought was to send a "Form" view model to spark and have it
dynamically render the views depending on what data is in the view
model, where the view model would be a direct representation of what
fields should be shown with what tags.

Has anyone else had to do something along these lines?

Sean
Reply all
Reply to author
Forward
0 new messages