System.Security.PermissionSet.SetPermission Method

Sets a permission to the System.Security.PermissionSet, replacing any existing permission of the same type.

Syntax

public IPermission SetPermission (IPermission perm)

Parameters

perm
The permission to set.

Returns

The set permission.

Remarks

This method removes any existing permission object of the same type from the System.Security.PermissionSet and replaces it with the perm parameter. If a permission that implements System.Security.Permissions.IUnrestrictedPermission is set on a System.Security.PermissionSet that is System.Security.Permissions.PermissionState.Unrestricted, the resulting System.Security.PermissionSet is no longer Unrestricted.

Requirements

Namespace: System.Security
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0