Building Security-Aware COM+ Components

Programmatic security allows the component writer to make decisions based on the role membership of the user executing the component. As usual, Visual Basic does an excellent job making this as simple as possible. In fact, you need to use only two methods of the SecurityCallContext class: IsSecurityEnabled and IsCallerInRole. The IsSecurityEnabled function allows you to check whether security was enabled for this component. The IsCallerInRole function allows you to check programmatically whether the user calling the component is a member of the specified role. Let's see how this works in practice by adding security awareness to our SimpleBank component.

Open the SimpleBank project in VB. To use the SecurityCallContext ...

Get Developing Secure Applications with Visual Basic now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.