IAuthorizationExtension.CreateSecurityDescriptor Method (AceCollection, SecurityItemType, String)


Updated: February 25, 2016

Returns the security descriptor that is stored with an individual item in the report server database.

Namespace:   Microsoft.ReportingServices.Interfaces
Assemblies:   Microsoft.ReportingServices.Interfaces (in Microsoft.ReportingServices.Interfaces.dll)
  Microsoft.ReportingServices.SharePoint.UI.WebParts (in Microsoft.ReportingServices.SharePoint.UI.WebParts.dll)

	PublicKey = "0024000004800000940000000602000000240000525341310004000001000100272736ad6e5f9586bac2d531eabc3acc666c2f8ec879fa94f8f7b0327d2ff2ed523448f83c3d5c5dd2dfc7bc99c5286b2c125117bf5cbe242b9d41750732b2bdffe649c6efb8e5526d526fdd130095ecdb7bf210809c6cdad8824faa9ac0310ac3cba2aa0523567b2dfa7fe250b30facbd62d4ec99b94ac47c7d3b28f1f6e4c8")]
byte[] CreateSecurityDescriptor(
	AceCollection acl,
	SecurityItemType itemType,
	out string stringSecDesc


Type: Microsoft.ReportingServices.Interfaces.AceCollection

The access code list created by the report server for the item. It contains a collection of access code entries.

Type: Microsoft.ReportingServices.Interfaces.SecurityItemType

The type of item for which the security descriptor is created.

Type: System.String

Optional. A user-friendly description of the security descriptor that can be used for debugging. This is not stored by the report server.

Return Value

Type: System.Byte[]

A serialized access code list.

Implement this method to serialize the access code list that is applied to an item in the report server database.

A security descriptor describes the following:

  • The group or user that has some type of permission to perform operations on the item.

  • The item's type.

  • A discretionary access control list controlling access to the item.

You can control access to an item and its properties using a security descriptor. Using a SQL Server Reporting Services security descriptor, you can:

  • Grant a trustee access rights to an item and its properties.

  • Identify trustees using a principal name or user ID.

  • Set, retrieve, and modify the descriptor programmatically.

Each item's security descriptor is created by a call to the CreateSecurityDescriptor method and accessed by a call to CheckAccess through the report server. This property is the item's descriptor in a serialized byte array. The descriptor is physically stored in the report server database, which is internally based on a collection of access control entries. When you request an access check on an item, the byte array is retrieved from the database and passed as an argument to the CheckAccess method. When you set this property for an item, the AceCollection is passed and you are required to create the binary descriptor for the item.

The following example uses the CreateSecurityDescriptor method to serialize the access code list for an item in the report server database. You can use this method to serialize additional security or authentication information as part of the security descriptor.

public byte[] CreateSecurityDescriptor(AceCollection acl, SecurityItemType itemType, out string stringSecDesc)
   // Creates a memory stream and serializes the ACL for storage.
   BinaryFormatter bf = new BinaryFormatter();
   MemoryStream result = new MemoryStream();
   bf.Serialize(result, acl);
   stringSecDesc = null;
   return result.GetBuffer();
Return to top