Property level authorization in a web form.

Property level authorization in a web form.

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


Pixel posted on Thursday, November 08, 2007

Another newbie question. 

Are there any examples around of property level authorization in a web form?  My business object deny's read access to one property based on the role but the web page just bombs out instead of making the textbox invisible.

Do I need to test authorization for each property in the UI page load and make it invisible myself?

Pixel

 

JoeFallon1 replied on Thursday, November 08, 2007

It matters which style you use for PropertyAuthorization. The common style throws an exception which is probably why your page "bombs". For read access of a Property change to the Boolean style instead and return a neutral value if denied. ("" for Strings and 0 for numeric values)

e.g.

If CanReadProperty("Prop")=True Then

  Return mProp

Else

  Return ""

End If

Joe

Copyright (c) Marimer LLC