System.Security.Permissions.SecurityAttribute Class

public abstract class SecurityAttribute : Attribute

Base Types

Object
  Attribute
    SecurityAttribute

Assembly

mscorlib

Library

BCL

Summary

This is the base class for attributes used by the security system.

Attributes

AttributeUsageAttribute(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple=true, Inherited=false)

See Also

System.Security.Permissions Namespace

Members

SecurityAttribute Constructors

SecurityAttribute() Constructor
SecurityAttribute(System.Security.Permissions.SecurityAction) Constructor

SecurityAttribute Methods

SecurityAttribute.CreatePermission Method

SecurityAttribute Properties

SecurityAttribute.Unrestricted Property


SecurityAttribute() Constructor

protected SecurityAttribute();

Summary

Constructs a new instance of the SecurityAttribute class.

See Also

System.Security.Permissions.SecurityAttribute Class, System.Security.Permissions Namespace

SecurityAttribute(System.Security.Permissions.SecurityAction) Constructor

public SecurityAttribute(SecurityAction action);

Summary

Constructs and initializes a new instance of SecurityAttribute with the specified SecurityAction.

Parameters

action
A SecurityAction value.

Exceptions

Exception TypeCondition
ArgumentExceptionaction is not a valid SecurityAction value.

See Also

System.Security.Permissions.SecurityAttribute Class, System.Security.Permissions Namespace

SecurityAttribute.CreatePermission Method

public abstract IPermission CreatePermission();

Summary

Returns a IPermission object that contains the security information of the current instance.

Return Value

A IPermission object.

Description

[Behaviors: Returns an instance of the permission type that corresponds to the current attribute. The returned object contains the security information of the current attribute.]

[Overrides: Override this method to create an instance of the permission type that corresponds to the current attribute. For example, the CreatePermission implementation of SecurityPermissionAttribute creates an instance of the SecurityPermission class.]

[Usage: Security information specified using attributes is stored in metadata. The security information in the metadata is created using the permission object returned by this method.

]

See Also

System.Security.Permissions.SecurityAttribute Class, System.Security.Permissions Namespace

SecurityAttribute.Unrestricted Property

public bool Unrestricted { get; set; }

Summary

Gets or sets full (unrestricted) permission to the resource protected by the current instance.

Property Value

true if full access to the protected resource is declared or is being set; otherwise, false .

See Also

System.Security.Permissions.SecurityAttribute Class, System.Security.Permissions Namespace