ReadWriteAuthorization and CheckBox

ReadWriteAuthorization and CheckBox

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


Phlar posted on Tuesday, January 25, 2011

I hope this is a quick/simple question.  I have a form with 5 Text boxes and 1 Check box. 

The Edit permissions properly grey's out all text boxes for those users whom only have Read-Only permissions.  However the check box is still editable (clickable).  The current databinding is being done on the Checked property.

I am also invoking the ResetControlAuthorization method on the ReadWriteAuthorization component within the ApplyAuthorizationRules() method.

Am I missing something (obvious) here?

JonnyBee replied on Thursday, January 27, 2011

Hi,

The ApplyAuthorization is set to True on the CheckBox and Checked is the only property beiing DataBound?

The other part that often fools RWA is databinding to a propertys property, Ex exposing a SmartDate property and binding to <dateproperty>.Text. RWA will then check authorization for "<dateproperty>.Text" and not for "<dataproperty>".

 

Phlar replied on Friday, January 28, 2011

Hi Jonny,

Yes the ApplyAuthorization is set to True and I only have one property being Databound.

stefan replied on Friday, January 28, 2011

You have to set the AutoCheck property of each checkBox control to false... annoyingAngry

Phlar replied on Friday, January 28, 2011

Thanks Stefan,

It appears this was the issue.  Once I set the AutoCheck property to false it worked.  That would have taken me a long time to figure out.  Much appreciated.

 

Phlar replied on Tuesday, February 22, 2011

stefan

You have to set the AutoCheck property of each checkBox control to false... annoyingAngry

It appears that setting the AutoCheck property disables it for all users in which case the Click event must contain code to determine whether the user has permissions to set the value (and then toggle that value) or by setting the enabled property.

Is there any other way?

Copyright (c) Marimer LLC