GetDirectCallerName Method

Retrieves the user name associated with the external process that called the currently executing method.

Applies To

SecurityProperty Object

Syntax

username = securityproperty.GetDirectCallerName( )

Part

username
The user name associated with the process from which the current method was invoked.

securityproperty
An object variable that evaluates to a SecurityProperty object.

Remarks

You use the GetDirectCallerName method to determine the user name associated with the process that called the object's currently executing method. The following scenarios illustrate the functionality of the GetDirectCallerName method.

A base process running on server A, as user A, calls into object X on server B, running as user B. Then object X calls into object Y, running on server C. If object Y calls GetDirectCallerName, the name of user B is returned.

Security can only be enforced across process boundaries. This means that the name returned by GetDirectCallerName is the name associated with the process that called into the process in which the current object is running, not necessarily the immediate caller into the object itself. If an object calls into another object within the same process, when the second object calls GetDirectCallerName, it will get the name of the most immediate caller outside its own process boundary, not the name of the object that directly called into it.

A base process, running on server A as user A, calls into object X on server B, running as user B. Then object X calls into object Y, running in the same process as object X, also on server B. When object Y calls GetDirectCallerName, the name of user A is returned , not the name of user B.

Example

See Also

Programmatic Security, Advanced Security Methods, ObjectContext Object