Determining instance authorization for the UI

Determining instance authorization for the UI

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


rcollette posted on Thursday, September 09, 2010

On page 366 of Expert C# 2008 Business objects, instance authorization methods are discussed.   However, I am not able to locate them in the framework.   In this discussion:

http://forums.lhotka.net/forums/p/5164/25044.aspx

Rocky mentions that the instance authorization methods should not be used and that instance authorization should be performed by the save, delete, etc methods themselves.  (So I assume at this point these methods have been removed from the framework).    However, this does not address the need for the UI to enable/disable controls based on authorization rules for the object instance.

What would be the consistent way of performing these types of checks in the UI?

Thanks,

Rich

JonnyBee replied on Thursday, September 09, 2010

Hi,

From the UI perspective you can ask the BO instance for:

CanExecuteMethod
CanReadProperty
CanWriteProperty

 

Copyright (c) Marimer LLC