IsSecurityEnabled

Description

Indicates whether or not security checking is enabled for a COM object running on COM+.

Applies to

TransactionServer objects

Syntax

transactionserver.IsSecurityEnabled (  )

Argument

Description

transactionserver

Reference to the TransactionServer service instance


Return value

Boolean.

Returns true if security checking is enabled and false if it is not.

Usage

Use IsSecurityEnabled to determine whether security checking is enabled for the current COM object.

If the COM object is running in the creator's process, IsSecurityEnabled always returns false.

Examples

The following example determines whether security checking is enabled and, if it is, checks whether the direct caller is in the Manager role before completing the call:

TransactionServer ts
integer li_rc
string str_role = "Admin"
 
li_rc = GetContextService( "TransactionServer",  &
     ts )
// Find out if security is enabled.
IF ts.IsSecurityEnabled() THEN
       // Find out if the caller is in the role.
    IF NOT ts.IsCallerInRole(str_role) THEN
        // do not complete call
    ELSE
    // execute call normally
    END IF
ELSE
    // security is not enabled
    // do not complete call
END IF

See also

ImpersonateClient

IsCallerInRole

IsImpersonating

RevertToSelf