IAuthorizationExtension.CreateSecurityDescriptor 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
返回报告服务器数据库中单个项目存储的安全描述符。
public:
cli::array <System::Byte> ^ CreateSecurityDescriptor(Microsoft::ReportingServices::Interfaces::AceCollection ^ acl, Microsoft::ReportingServices::Interfaces::SecurityItemType itemType, [Runtime::InteropServices::Out] System::String ^ % stringSecDesc);
public byte[] CreateSecurityDescriptor(Microsoft.ReportingServices.Interfaces.AceCollection acl, Microsoft.ReportingServices.Interfaces.SecurityItemType itemType, out string stringSecDesc);
abstract member CreateSecurityDescriptor : Microsoft.ReportingServices.Interfaces.AceCollection * Microsoft.ReportingServices.Interfaces.SecurityItemType * string -> byte[]
Public Function CreateSecurityDescriptor (acl As AceCollection, itemType As SecurityItemType, ByRef stringSecDesc As String) As Byte()
参数
- acl
- AceCollection
报告服务器为该项目创建的访问代码列表。 它包含了一系列访问代码条目。
- itemType
- SecurityItemType
创建安全描述符的项目类型。
- stringSecDesc
- String
Optional. 一个用户友好的安全描述符,可用于调试。 报告服务器不会存储这些数据。
返回
一个序列化的访问代码列表。
示例
以下示例使用该 CreateSecurityDescriptor 方法序列化报告服务器数据库中某个项目的访问代码列表。 你可以用这种方法将额外的安全或认证信息序列化,作为安全描述符的一部分。
Public Function CreateSecurityDescriptor(acl As AceCollection, itemType As SecurityItemType, ByRef stringSecDesc As String) As Byte()
' Creates a memory stream and serializes the ACL for storage.
Dim bf As New BinaryFormatter()
Dim result As New MemoryStream()
bf.Serialize(result, acl)
stringSecDesc = Nothing
Return result.GetBuffer()
End Function 'CreateSecurityDescriptor
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();
}
注解
实现此方法以序列化应用到报告服务器数据库中项目的访问代码列表。
安全描述符描述了以下内容:
拥有对该项目执行操作权限的组或用户。
项的类型。
一个可自由裁量的访问控制列表,控制对该物品的访问。
你可以用安全描述符来控制对某项物品及其属性的访问。 使用 SQL Server Reporting Services 安全描述符,您可以:
授予受托人对某项物品及其财产的访问权。
使用委托人姓名或用户ID来识别受托人。
通过程序设置、检索和修改描述符。
每个项目的安全描述符通过调用 CreateSecurityDescriptor 方法创建,并通过报告服务器调用访问 CheckAccess 。 该属性是序列化字节数组中的项目描述符。 描述符物理存储在报告服务器数据库中,该数据库内部基于一组访问控制条目。 当你请求对某个项目进行访问检查时,字节数组会从数据库中获取并作为参数传递给方法 CheckAccess 。 当你为某个项目设置这个属性时,会传递 , AceCollection 你需要为该项目创建二进制描述符。