IsSecurityEnabled PowerScript function
Description
Indicates whether or not security checking is enabled for
a COM object running on COM+.
Controls
TransactionServer objects
Syntax
|
1 |
<span>transactionserver</span>.<span>IsSecurityEnabled</span> ( <span> </span>) |
|
Argument |
Description |
|---|---|
|
transactionserver |
Reference to the TransactionServer service |
Return Values
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:
|
1 |
TransactionServer ts |
|
1 |
integer li_rc |
|
1 |
string str_role = "Admin" |
|
1 |
|
1 |
li_rc = GetContextService( "TransactionServer", & |
|
1 |
ts ) |
|
1 |
// Find out if security is enabled. |
|
1 |
IF ts.<span>IsSecurityEnabled</span>() THEN |
|
1 |
// Find out if the caller is in the role. |
|
1 |
IF NOT ts.IsCallerInRole(str_role) THEN |
|
1 |
// do not complete call |
|
1 |
ELSE |
|
1 |
// execute call normally |
|
1 |
END IF |
|
1 |
ELSE |
|
1 |
// security is not enabled |
|
1 |
// do not complete call |
|
1 |
END IF |
See Also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest