public sealed class SecurityManager
|
CheckExecutionRights | Read-write Gets or sets a value indicating whether code must have SecurityPermissionFlag.Execution in order to execute. |
SecurityEnabled | Read-write Gets or sets a value indicating whether security is enabled. |
Equals (inherited from System.Object) |
See base class member description: System.Object.Equals Derived from System.Object, the primary base class for all objects. |
GetHashCode (inherited from System.Object) |
See base class member description: System.Object.GetHashCode Derived from System.Object, the primary base class for all objects. |
GetType (inherited from System.Object) |
See base class member description: System.Object.GetType Derived from System.Object, the primary base class for all objects. |
IsGranted | Determines whether a permission is granted to the caller. |
LoadPolicyLevelFromFile | Loads a PolicyLevel from the specified file. |
LoadPolicyLevelFromString | Loads a PolicyLevel from the specified string. |
PolicyHierarchy | Provides an enumerator to access the security policy hierarchy by levels, such as computer policy and user policy. |
ResolvePolicy | Overloaded:ResolvePolicy(Evidence evidence) Determines what permissions to grant to code based on the specified evidence. |
ResolvePolicy | Overloaded:ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, out PermissionSet denied) Determines what permissions to grant to code based on the specified evidence and requests. |
ResolvePolicyGroups | Gets a collection of code groups matching the specified evidence. |
SavePolicy | Saves the modified security policy state. |
SavePolicyLevel | Saves a modified security policy level loaded with SecurityManager.LoadPolicyLevelFromFile. |
ToString (inherited from System.Object) |
See base class member description: System.Object.ToString Derived from System.Object, the primary base class for all objects. |
Finalize (inherited from System.Object) |
See base class member description: System.Object.Finalize Derived from System.Object, the primary base class for all objects. |
MemberwiseClone (inherited from System.Object) |
See base class member description: System.Object.MemberwiseClone Derived from System.Object, the primary base class for all objects. |
Hierarchy:
public static bool CheckExecutionRights {get; set;}
|
A change to this property is not persisted until SecurityManager.SavePolicy is called. New processes will not be affected by the change until it is persisted in the registry.
public static bool SecurityEnabled {get; set;}
|
Disabling security makes the system vulnerable to attacks by malicious code such as viruses and worms. Turning off security gains some extra performance and should only be done when other security measures have been taken to ensure overall system security is not breached. Examples of other security precautions include disconnecting from public networks, physically securing computers, and so on.
A change to this property is not persisted in the registry until SecurityManager.SavePolicy is called. New processes will not be affected by the change until it is persisted in the registry. Changing the value of this property in a running process does not necessarily change the state in the expected manner. To ensure changes have taken effect, you must call SecurityManager.SavePolicy and start a new process.
if ( !SecurityManager.SecurityEnabled ) { throw new SecurityException(myResourceManager.GetString("Security_Required")); }
~SecurityManager(); |
public virtual int GetHashCode(); |
public Type GetType(); |
public static bool IsGranted( |
perm
public static PolicyLevel LoadPolicyLevelFromFile( |
path
type
Exception Type | Condition |
---|---|
ArgumentNullException | The path parameter is null. |
ArgumentException | The file indicated by the path parameter does not exist. |
public static PolicyLevel LoadPolicyLevelFromString( |
str
type
Exception Type | Condition |
---|---|
ArgumentNullException | The str parameter is null. |
ArgumentException | The str parameter is not valid. |
protected object MemberwiseClone(); |
public static IEnumerator PolicyHierarchy(); |
Minimum policy hierarchy consists of a machine level, an enterprise level, and a user level. However, the hierarchy can include additional levels.
public static PermissionSet ResolvePolicy( |
evidence
public static PermissionSet ResolvePolicy( |
evidence
reqdPset
optPset
denyPset
denied
Exception Type | Condition |
---|---|
PolicyException | Policy fails to grant the minimum required permissions specified by the reqdPset parameter. |
public static IEnumerator ResolvePolicyGroups( |
evidence
Code groups will be returned from all applicable levels of the policy hierarchy matching the evidence parameter.
public static void SavePolicy(); |
public static void SavePolicyLevel( |
level
public virtual string ToString(); |