GetSystemPermissions 方法
擷取目前使用者的系統權限。這個方法只適用於原生模式。
命名空間: ReportService2010
組件: ReportService2010 (在 ReportService2010.dll 中)
語法
'宣告
<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()
'用途
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[]
傳回值
型別:array<System. . :: . .String> [] () [] []
String 物件的陣列,其中包含與使用者所指派系統工作與角色相關聯的權限清單。
備註
The table below shows header and permissions information on this operation.
SOAP Header Usage |
(Out) ServerInfoHeaderValue |
Native Mode Required Permissions |
None |
SharePoint Mode Required Permissions |
Not supported |
This method throws an OperationNotSupportedSharePointMode exception when invoked in SharePont mode.
範例
To compile this code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see Compiling and Running Code Examples.
The following code example uses the GetSystemPermissions method to retrieve a list of permissions associated with the system tasks and roles to which the current user is assigned:
[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();
}
}