Export (0) Print
Expand All

SecurityPermissionAttribute.ControlPrincipal Property

Gets or sets a value indicating whether permission to manipulate the current principal is declared.

[Visual Basic]
Public Property ControlPrincipal As Boolean
[C#]
public bool ControlPrincipal {get; set;}
[C++]
public: __property bool get_ControlPrincipal();
public: __property void set_ControlPrincipal(bool);
[JScript]
public function get ControlPrincipal() : Boolean;
public function set ControlPrincipal(Boolean);

Property Value

true if permission to manipulate the current principal is declared; otherwise, false.

Remarks

For more information, see Principal.

Example

[Visual Basic] 
' Set the Assertion,UnmanagedCode, ControlAppDomain, ControlDomainPolicy, ontrolEvidence, 
' ControlPolicy, ControlPrincipal, ControlThread, Execution, Flags, Infrastructure, 
' RemotingConfiguration, SerializationFormatter, and SkipVerification properties.
<SecurityPermissionAttribute(SecurityAction.Deny, Assertion:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlAppDomain:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlDomainPolicy:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlEvidence:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlPolicy:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlPrincipal:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, ControlThread:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, Execution:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, Flags:=SecurityPermissionFlag.NoFlags), _
SecurityPermissionAttribute(SecurityAction.Deny, Infrastructure:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, RemotingConfiguration:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, SerializationFormatter:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, SkipVerification:=True), _
SecurityPermissionAttribute(SecurityAction.Deny, UnmanagedCode:=True)> _
Public Shared Sub DenySecurityPermissions()

[C#] 
// Set the ControlPrincipal property.
    [SecurityPermissionAttribute(SecurityAction.Deny, ControlPrincipal = true)] 

[C++] 
// Set the ControlPrincipal property.
[SecurityPermissionAttribute(SecurityAction::Deny, ControlPrincipal = true)]

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

SecurityPermissionAttribute Class | SecurityPermissionAttribute Members | System.Security.Permissions Namespace

Show:
© 2014 Microsoft