Is there an easy way of locking some child BusinessBase objects to be read only based on if a property is empty or not?
I'm suspecting i may need to use some authorization rules...? Or is there a hidden "IsReadOnly" base property?
This was probably covered in the book, but i've been on a 72 hour CSLA binge and I dont remember some of these "little" things.
Thanks in advance.
You can always override CanWriteProperty() to return false when you want to prevent editing of fields on the given record.
If you want to prevent adding / removing of items from a list that involves a bit more work and depends on how you interact with GUI (grids, etc).
Yes, that makes sense and seems simple enough to implement. To prevent removing the child items which meet specific criteria couldn't I just do an if...then in a public remove method on the businesslistbase object?
I know that I asked for an "easy" way...but would the recommended way be to use authorization rules to specify roles which can edit and delete based on a property value?
On your derived BusinessListBase class, you can override RemoveItem(..) like this:
protected override void RemoveItem(int index) { if ([condition is met]) base.RemoveItem(index); }
Troncho
It would be nice to have some sort of BusinessRule to accept or reject adding and removing items from a BusinessListBase
Copyright (c) Marimer LLC