IApplicationTrustManager::DetermineApplicationTrust Method (ActivationContext^, TrustManagerContext^)

 

Determines whether an application should be executed and which set of permissions should be granted to it.

Namespace:   System.Security.Policy
Assembly:  mscorlib (in mscorlib.dll)

ApplicationTrust^ DetermineApplicationTrust(
	ActivationContext^ activationContext,
	TrustManagerContext^ context
)

Parameters

activationContext
Type: System::ActivationContext^

The activation context for the application.

context
Type: System.Security.Policy::TrustManagerContext^

The trust manager context for the application.

Return Value

Type: System.Security.Policy::ApplicationTrust^

An object that contains security decisions about the application.

The DetermineApplicationTrust method is called by the host to determine whether an application should be executed and which set of permissions it should be granted. DetermineApplicationTrust returns an ApplicationTrust object with a DefaultGrantSet property that contains a permission set representing the permissions to be granted to each assembly executing within the context of the application. The granted permissions do not apply to assemblies in the global assembly cache. The ApplicationTrust object also has an IsApplicationTrustedToRun property that the trust manager sets to indicate whether the application should be trusted. If the trust manager indicates that the application can be trusted, the host activates the application and grants its assemblies the set of permissions provided in the ApplicationTrust collection.

The following example shows an implementation of the DetermineApplicationTrust method for a custom trust manager. This code example is part of a larger example provided for the IApplicationTrustManager interface.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: