Required for setting the security token that will be used for all connections in the current thread or process.

A call to either SetThreadSecurityToken or SetProcessSecurityToken is required to communicate with the Content Engine server. When a SecurityToken is specified, a request to the server is limited, through authorization access control, to the operations that have been granted to the specified principal. Correspondingly, if a locale is specified, the server attempts to return localizable messages, such as exception text, according to the language code specified by the locale.

As noted above, UserContext operations are performed on a per-thread or per-process basis. When working with multiple locales, for example when servicing requests via a thread pool, you must explicitly call SetLocale at the beginning of each new thread (request). The following code snippet illustrates the call to make at the startup phase of every request, where reqLocale is the locale (System.Globalization.CultureInfo) to be used for this request:

            UserContext uc = UserContext.Get();
            uc.SetLocale(reqLocale);
            

Namespace:  FileNet.Api.Util
Assembly:  FileNet.Api (in FileNet.Api.dll)

ToggleSyntax

Visual Basic (Declaration)
<ObsoleteAttribute("The UserContext class is obsolete, replaced by ClientContext")> _
Public Class UserContext
C#
[ObsoleteAttribute("The UserContext class is obsolete, replaced by ClientContext")]
public class UserContext
Visual C++
[ObsoleteAttribute(L"The UserContext class is obsolete, replaced by ClientContext")]
public ref class UserContext
JavaScript
FileNet.Api.Util.UserContext = function();

Type.createClass(
	'FileNet.Api.Util.UserContext');

ToggleInheritance Hierarchy

System..::.Object
  FileNet.Api.Util..::.UserContext

ToggleSee Also