See Also: SecurityPermissionAttribute Members
The security permissions are defined in the System.Security.Permissions.SecurityPermissionFlag enumeration and are specified using the SecurityPermissionAttribute.Flags property.
The security information declared by a security attribute is stored in the metadata of the attribute target, and is accessed by the system at run-time. Security attributes are used for declarative security only. For imperative security, use the corresponding permission class, System.Security.Permissions.SecurityPermission.
The allowable System.Security.Permissions.SecurityPermissionAttribute targets are determined by the System.Security.Permissions.SecurityAction passed to the constructor.
In the following example, the attribute target is an assembly. The attribute declares that the ability to assert permissions on behalf of callers is the minimum permission required for the assembly to execute.