I have a requirement that only super-admins can modify “live” data.
Currently, if an ordinary admin wants to make a change to live data:-
- A super-admin unpublishes the data
- The ordinary admin makes their changes
- A super-admin approves the changes and publishes the data
What are my options if I want to try to eliminate step 1 and have the old data remain live until the super-user approves the changes?
I’m using ASP.NET MVC and EF4 and so I’m particularly interested in solutions around EF that can be made transparent to my controller, however I’m also interested to hear about solutions in the database layer (or for entirely different contexts)
First of all, since you’re talking about role-based activities taking place, I find it hard to come up with an appropriate solution that doesn’t involve the application/business tier. I believe your data access layer should be oblivious to the fact that a super-admin or an ordinary admin is calling its methods.
In any case, one way to handle this would be to create a PendingChanges table and save ordinary admins’ changes to it with a flag indicating that it’s pending approval. Then once the super-admin approves it, you copy the record from PendingChanges into the live table.