ReadWriteAuthorization and readonly property

ReadWriteAuthorization and readonly property

Old forum URL: forums.lhotka.net/forums/t/1622.aspx


dean posted on Sunday, October 29, 2006

    I thought that in 2.01 the readwriteauthorization control (or windows databinding?) was catching if a property was readonly and setting the readonly property of the textbox to false. Was I just imagining this?

Dean

ajj3085 replied on Monday, October 30, 2006

That's what I thought too, but that's not how the componet works.  It works by checking the result of CanWriteProperty.  So if that returns true for your readonly property (which it will, since you probably never setup AuthRules or overrode CanWriteProperty) the control will be enabled.

DansDreams replied on Monday, December 18, 2006

Hey, need to bump this up because it's come up for me.

I've added an override to CanWriteProperty in my CustomBusinessBase class, but while that works I don't get the advantage of the cache in the Csla.Core.BusinessBase class.  I don't really want to have another cache in my class.

Has Rocky ever addressed this?  This seems like such a powerful feature it would have been added by now.  Or was the thought that BusinessBase objects don't usually have a lot of read only properties and the extra reflection call on the first permission check would be a (usually) wasted performance hit?

DansDreams replied on Monday, December 18, 2006

One more thing.  The extender component allows you to add a property to the object to which it applies.  In this case it adds the ApplyAuthorization property to controls in the forms designer.

But from what I can see this new property is going to default to the default for the type, which is false for a boolean.  How do I make the default true?

ajj3085 replied on Thursday, December 21, 2006

I think you'd have to modify the component, because it defines what the default value should be.

Copyright (c) Marimer LLC