Authorizer problemOld forum URL: forums.lhotka.net/forums/t/5643.aspx
ajj3085 posted on Tuesday, October 21, 2008Hi,
I'm having a problem with the authorizer. I have two user controls; one displays readonly data. It has a progress bar visible while it's loading data, bound to the controls CslaDataProvider IsBusy property (well... actually it's bound to the BO's IsBusy property.. BindsDirectlyToSource=False).
Anyway, I'm using the view only user control in another user control, and the readonly control (call it DataViewCtrl) is contained within an authorizer, which is contained within an objectstatus.
The problem is that the progress bar correctly hides when the form is displayed. However, once the Save command is execute on the parent user control, the authorizer somehow digs into the DataViewCtrl and changes the progress bar's Visiblity to Visible.
I've tried adding csla:Authroizer.NotVisibleMode="Ignore", but the behavior persists.
ajj3085 replied on Tuesday, October 21, 2008More details:
The authorizer's source is the edited BO, which is expected. It's trying to check the IsBusy property (where it got that, I'm not sure..) and of course that can always be read.
So SetRead falls into the switch for visiblityMode (collapsed) and the control (which is the progress bar on DataViewControl!!) is collasped (correctly) and the authorizer changes it to Visible.
ajj3085 replied on Tuesday, October 21, 2008Well, I fixed this by putting csla:Authorizer.NotVisibleMode="Ignore" on the progress bar directly.
RockfordLhotka replied on Tuesday, October 21, 2008
There's a known issue with Authorizer and complex controls, where it messes with subcontrols inside the main control. It is in the bug list to be fixed.
However, its priority dropped in 3.6 because PropertyStatus does a much better job of dealing with authorization, and I'm seriously considering dropping Authorizer at some point. Even if this bug were fixed, it is (comparatively) very inefficient.
ajj3085 replied on Wednesday, October 22, 2008Ahh.. didn't know it was a known issue.
Is there any good documentation on using PropertyStatus? It looks like it appeared in 3.6. Is it meant to replace ObjectStatus and Authorizer?
RockfordLhotka replied on Wednesday, October 22, 2008
PropertyStatus is meant to replace Authorizer, and to handle
validation rules (all three severities), and to handle async busy notification.
It does not replace ObjectStatus. In Silverlight
CslaDataProvider actually replaces ObjectStatus. In WPF I still use
ObjectStatus, though as a resource, not a container. That’s a simpler
ajj3085 replied on Wednesday, October 22, 2008Ok... that clears up a lot of me.. thanks!
Copyright (c) Marimer LLC