Platform SDK: Transaction Server |
IObjectContext.IsCallerInRole, IObjectContext.IsSecurityEnabled Methods Example
[This product will work only on Windows NT 4.0 versions and earlier. For Windows 2000 and later, see COM+ (Component Services).]
import com.ms.mtx.*; IObjectContext objContext = null; objContext = MTx.GetObjectContext(); // Find out if Security is enabled. if (objContext.IsSecurityEnabled()) { //Then find out if the caller is in the right role. if (!objContext.IsCallerInRole("Manager")) { // If not, do something appropriate here. } } else { // If security's not enabled, do something // appropriate here. }