Suggestion for ValidationRules & ApplyAuthorizationRules

Suggestion for ValidationRules & ApplyAuthorizationRules

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


Vinodonly posted on Wednesday, September 06, 2006

If ValidationRules can check the rules before adding i.e. update it with the new values instead of adding (to avoid duplicating rules, same like broken rules) then it can be helpful.

If ApplyAuthorizationRules can also support hiding control (if possible alongwith its associated label), it can be very useful as in many cases, we don't want the user to know that a particular field exists also.

Kindly advise your comments.

ajj3085 replied on Wednesday, September 06, 2006

I'm not sure what you mean regarding rules.  In 2.0.3 and below, each object has its own 'copy' of the rules, but in 2.1 beta refresh, rules can be loaded once per type.. so the rules aren't 'duplicated.' 

You can create your own extender control which works similar to ApplyAuthRules that will hide controls if CanReadProperty returns false for the property to which the control is bound.

Andy

Vinodonly replied on Wednesday, September 06, 2006

thanks for your reply. noted abt creating own extender control.

I have not seen the code in beta yet, code which i'm referring to is for 2.0.3, ValidationRules.AddRules method there is directly adding the rule without doing any checking like how it is done when adding brokenrules..

any ideas when the beta version be converted to stable versiion.

 

ajj3085 replied on Wednesday, September 06, 2006

I see.  Well, AddBusinessRules should only be called when your object is created, thus any rules should be added only once, since in 2.0.3 rules are per-instance.  So technically you should never have the same rule added twice (unless your calling AddBusinessRules yourself, which you should not be doing).

In 2.1 beta, there are checks done to ensuer the same rule isn't added more than once, since rules by default are stored at the type level instead of at the instance level.

I think Rocky's timeframe is near the end of this month to move the 2.1 to a 'stable' designation.  I've been building on it for a few weeks now though and haven't had any issues.

If you update to the beta, you will be helping to test it, which may mean we get it sooner. Wink [;)]

Andy

Copyright (c) Marimer LLC