Help with ForcedCurrentValueWrite

Posts   
 
    
Harry
User
Posts: 73
Joined: 26-Jun-2007
# Posted on: 10-Jul-2008 16:21:06   

I need to know if there is any way to prevent someone from calling ForcedCurrentValueWrite ?

I have some entities that are being used by a client and the developers are calling this method and bypassing security and validation code.

Is there anything I can do?

Thanks.

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 10-Jul-2008 17:04:53   

You may build your own version of the ORMSupportClasses dll and change its accessor to protected.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39866
Joined: 17-Aug-2003
# Posted on: 10-Jul-2008 17:11:29   

Walaa wrote:

You may build your own version of the ORMSupportClasses dll and change its accessor to protected.

I'd make it protected internal, as the framework uses the method to set the field's value during a fetch.

The method is public because it is used to set the ID in readonly PK fields for operations directly on the DB.

Also, could you direct these developers to stop using this method? I mean, they can also set CurrentValue and the IsChanged flag, so it's not as if it's impossible to do.

Also, in a normal object, if the property is only a getter, it's still possible to set private member variables, if the developer wants to. I.o.w.: the developers using the code should follow procedure how to use your code.

Frans Bouma | Lead developer LLBLGen Pro