次の方法で共有


GetPermissions メソッド

レポート サーバー データベースの特定のアイテムに関連付けられたユーザー権限を返します。

名前空間:  ReportService2005
アセンブリ:  ReportService2005 (ReportService2005.dll)

構文

'宣言
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetPermissions", RequestNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",  _
    ResponseNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetPermissions ( _
    Item As String _
) As String()
'使用
Dim instance As ReportingService2005
Dim Item As String
Dim returnValue As String()

returnValue = instance.GetPermissions(Item)
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetPermissions", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public string[] GetPermissions(
    string Item
)
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetPermissions", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
public:
array<String^>^ GetPermissions(
    String^ Item
)
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/GetPermissions", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
member GetPermissions : 
        Item:string -> string[] 
public function GetPermissions(
    Item : String
) : String[]

パラメーター

戻り値

型: array<System. . :: . .String> [] () [] []
現在のユーザーの、アイテムに割り当てられているタスクおよびロールに関連付けられた権限の一覧を表す String[] オブジェクトの配列です。

説明

SOAP ヘッダー

(Out) ServerInfoHeaderValue

必要な権限

なし

使用例

このコード例をコンパイルするには、Reporting Services の WSDL を参照し、特定の名前空間をインポートする必要があります。詳細については、「Compiling and Running Code Examples」を参照してください。次のコード例では、GetPermissions メソッドを使用して、Company Sales レポートに関連付けられた権限を取得します。

Imports System
Imports System.Web.Services.Protocols

Class Sample
   Public Shared Sub Main()
      Dim rs As New ReportingService2005()
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials

      Try
         Dim permissions As [String]() = rs.GetPermissions("/SampleReports/Company Sales")

         Dim perm As String
         For Each perm In  permissions
            Console.WriteLine(perm)
         Next perm

      Catch e As SoapException
         Console.WriteLine(e.Detail.InnerXml.ToString())
      End Try
   End Sub 'Main
End Class 'Sample
using System;
using System.Web.Services.Protocols;

class Sample
{
   public static void Main()
   {
      ReportingService2005 rs = new ReportingService2005();
      rs.Credentials = System.Net.CredentialCache.DefaultCredentials;

      try
      {
         String[] permissions = rs.GetPermissions( "/SampleReports/Company Sales" );

         foreach ( string perm in permissions )
         {
            Console.WriteLine( perm );
         }
      }

      catch ( SoapException e )
      {
         Console.WriteLine( e.Detail.InnerXml.ToString() );
      }
   }
}

このメソッドのコンソール出力は、次の例のようになります。

Delete
Execute and View
Read Properties
Update Properties
Update Parameters
Read Data Sources
Update Data Sources
Read Report Definition
Update Report Definition
Create Subscription
Delete Subscription
Read Subscription
Delete Report History
Update Subscription
Create Any Subscription
Delete Any Subscription
Read Any Subscription
Read Security Policies
Update Security Policies
Update Any Subscription
Read Policy
Update Policy
List Report History
Create Report History
Execute
Create Link