Compartilhar via


SharePointPermissionAttribute Class

The SharePointPermissionAttribute class allows security actions for SharePointPermission to be applied to code using declarative security. This class cannot be inherited.

System.Object

   System.Attribute

      System.Security.Permissions.SecurityAttribute

         System.Security.Permissions.CodeAccessSecurityAttribute

            Microsoft.SharePoint.Security.SharePointPermissionAttribute

Public Constructors

The following table shows the constructors of the SharePointPermissionAttribute class and a brief description of each.

Name Description
SharePointPermissionAttribute(System.Security.Permissions.SecurityAction ) Initializes a new instance of the SharePointPermissionAttribute class.

Public Methods

The following table shows the methods of the SharePointPermissionAttribute class and a brief description of each.

Name Description
CreatePermission Creates and returns a new SharePointPermission object.

Public Properties

The following table shows the properties of the SharePointPermissionAttribute class, the data type of each property, and a brief description of each.

Name Data Type Description
ObjectModel Boolean Gets or sets a value indicating whether use of the Microsoft SharePoint Products and Technologies object model is allowed.
Unrestricted Boolean Gets or sets a value indicating whether full (unrestricted) permission to the resource protected by the attribute is declared.
UnsafeSaveOnGet Boolean Gets or sets a value indicating whether saving to the SharePoint Products and Technologies database is allowed during an HTTP-GET request.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Remarks

The scope of the declaration that is allowed depends on the SecurityAction that is used.

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 only for declarative security. For imperative security, use the corresponding permission class.

Requirements

Namespace: Microsoft.SharePoint.Security

Platforms: Microsoft Windows Server 2003

Assembly: Microsoft SharePoint Security (in Microsoft.SharePoint.Security.dll)

Security: Code Access Security