I want to modify one list (actually info stored in a database). A person doesn't have access to update every part of the list, but can update and delete parts they do have access to and add whatever they want to the list.
Here's my pseudocode:
ModifiedList OriginalList OriginalListWithUserRights for each Thing in ModifiedList do if Thing in OriginalList then //Leave Along - nothing to change else OriginalList.add(Thing) for each Thing in OriginalList do if (Thing in ModifiedList) then //LeaveAlone - nothing to change (same as above) else for each RightsThing in OriginalListWithUserRights do if RightsThing not in OriginalList then //Leave Alone - don't remove things you don't have rights to else OriginalList.Remove(RightsThing) OriginalList.ReIndex() //because there will be some gaps
So, I guess this would work, but I think it's not right because it's just an obvious solution. I don't need to start with three lists as my inputs to this function. I could look up particular pieces of information while I'm iterating through my modified list. It just seems to structured and not object oriented enough for 2014.
One problem I have is that I'm going to be adding everything to the end of the list, seems like I should be adding things relative to where they were in the passed in list, but in a way that doesn't mess up the order of things that are not in my OriginalListWithUserRights.