RevertToSelf
PowerScript function
Description
Restores the security attributes for a COM object that is running on
COM+ and impersonating the client.
Applies to
TransactionServer objects
Syntax
|
1 |
transactionserver.RevertToSelf ( ) |
|
Argument |
Description |
|---|---|
|
transactionserver |
Reference to the TransactionServer service instance |
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs.
Usage
COM objects running on COM+ can use the ImpersonateClient function
to run in the client’s security context so that the object has access to
the same resources as the client. Use RevertToSelf to restore the object’s
security context.
Examples
The following example creates an instance of the TransactionServer
service and checks whether the COM object is currently running in the
client’s security context. If it is, it reverts to the object’s security
context:
|
1 2 3 4 5 6 7 |
TransactionServer txninfo_test integer li_rc li_rc = GetContextService( "TransactionServer", & txninfo_test ) IF txninfo_test.IsImpersonating() THEN & txninfo_test.RevertToSelf() |
See also