Disable Ability to Add to Collection or Delete From Collection
Nicholas-Westby opened this issue · 1 comments
I have a collection of reviews that are stored in a database table. This table is populated by people who visit the website and leave what are essentially product reviews.
What I'd like to do is use Fluidity to mostly view those reviews. However, there is one thing that can be edited on each review (a toggle to approve reviews so they can display on the website). What they should not be able to do is delete reviews and add reviews.
I see that I can do this to make the entire collection read only:
collection.MakeReadOnly();
That's 99% of what I need, except then they can't edit the toggle on the reviews.
I suppose what I'm after is a "shallow read only". Meaning, the collection itself can't be modified, but the data on those items can be modified. Sort of like IReadOnlyCollection in C#.
I realize one workaround would be to create my own repository and hack it a bit so items can't be deleted or added. That's quite a lot of work though for something that could be built in, and it would be confusing for the user because they'd still see the buttons to add and delete items.
This will be resolved by in progress PR #75. Please feel free to give it a try and feedback on the PR