Metoda ReportingService2010.GetSystemPermissions
Pobiera uprawnień systemowych bieżącego użytkownika.Metoda ta dotyczy tylko trybu macierzystego.
Przestrzeń nazw: ReportService2010
Zestaw: ReportService2010 (w ReportService2010.dll)
Składnia
'Deklaracja
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetSystemPermissions", RequestNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", _
ResponseNamespace := "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
<SoapHeaderAttribute("TrustedUserHeaderValue")> _
Public Function GetSystemPermissions As String()
'Użycie
Dim instance As ReportingService2010
Dim returnValue As String()
returnValue = instance.GetSystemPermissions()
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetSystemPermissions", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
[SoapHeaderAttribute("TrustedUserHeaderValue")]
public string[] GetSystemPermissions()
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetSystemPermissions", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
public:
array<String^>^ GetSystemPermissions()
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/GetSystemPermissions", RequestNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
ResponseNamespace = "https://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
[<SoapHeaderAttribute("TrustedUserHeaderValue")>]
member GetSystemPermissions : unit -> string[]
public function GetSystemPermissions() : String[]
Wartość zwracana
Typ: array<System.String[]
Tablica String obiektów, które zawiera listę uprawnień związanych z zadań i ról, do których użytkownik ma przypisaną.
Uwagi
W poniższej tabela przedstawiono informacje nagłówka i uprawnienia na tej operacji.
Użycie nagłówek protokołu SOAP |
(Ruch wychodzący)ServerInfoHeaderValue |
Tryb macierzysty wymagane uprawnienia |
Brak |
Tryb programu SharePoint wymagane uprawnienia |
Nieobsługiwana |
Ta metoda wygeneruje OperationNotSupportedSharePointMode wyjątek przy wywołaniu w trybie SharePoint.
Przykłady
Aby skompilować ten przykład kodu, należy odwołać WSDL usług Reporting i przywozu niektórych obszarów nazw.Aby uzyskać więcej informacji, zobacz temat Compiling and Running Code Examples.
Następujący kod w przykładzie wykorzystano GetSystemPermissions metoda pobrania listy uprawnienia związane z zadań i ról, do których przypisano bieżącego użytkownika:
[C#]
using System;
using System.IO;
using System.Text;
using System.Web.Services.Protocols;
#endregion
class Sample
{
public static void Main()
{
ReportingService2010 rs = new ReportingService2010();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
string[] userpermissions = rs.GetSystemPermissions();
for (int t = 0; t <= userpermissions.GetUpperBound(0); t++)
Console.WriteLine(userpermissions[t]);
Console.ReadKey();
}
}