次の方法で共有


Security.CreateTemplates メソッド

1 つまたは複数のセキュリティ テンプレートを作成します。

名前空間:  WebSvcSecurity
アセンブリ:  ProjectServerServices (ProjectServerServices.dll 内)

構文

'宣言
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/Security/CreateTemplates", RequestNamespace := "https://schemas.microsoft.com/office/project/server/webservices/Security/",  _
    ResponseNamespace := "https://schemas.microsoft.com/office/project/server/webservices/Security/",  _
    Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Sub CreateTemplates ( _
    templates As SecurityTemplatesDataSet _
)
'使用
Dim instance As Security
Dim templates As SecurityTemplatesDataSet

instance.CreateTemplates(templates)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/Security/CreateTemplates", RequestNamespace = "https://schemas.microsoft.com/office/project/server/webservices/Security/", 
    ResponseNamespace = "https://schemas.microsoft.com/office/project/server/webservices/Security/", 
    Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public void CreateTemplates(
    SecurityTemplatesDataSet templates
)

パラメーター

注釈

templatesパラメーターは、新しいテンプレートを定義する、 SecurityTemplatesテーブルに少なくとも 1 つのSecurityTemplatesDataSet.SecurityTemplatesRowを含める必要があります。SecurityTemplatesDataTableのSecurityTemplatesRowの複数のオブジェクトを含めることができます。Project Server には、次のそれぞれのSecurityTemplatesRowを検証します。

  • 一意のテンプレート名および GUID

SecurityTemplatesDataSetでDataTableの 3 つのオブジェクトがあります。SecurityTemplatesDataTableのみのデータを含める必要があります。データ テーブルでは、通りです。

  1. SecurityTemplates各行には、カテゴリ GUID、名、および説明を指定します。セキュリティ カテゴリを作成するには、GUID と名前を (WSEC_TMPL_UID および WSEC_TMPL_NAME) が必要です。

  2. CategoryPermissions省略可能です。各行は、テンプレート GUID とカテゴリ権限の GUID を指定し、 AllowまたはDenyのアクセス許可を設定します。カテゴリ権限については、 PSSecurityCategoryPermission構造体を参照してください。

  3. GlobalPermissions省略可能です。各行は、テンプレート GUID、および、グローバル アクセス権 GUID を指定し、 AllowまたはDenyのアクセス許可を設定します。グローバル アクセス権については、 PSSecurityGlobalPermission構造体を参照してください。

有効なテンプレートの例については、[追加] または [テンプレートの編集] ページのフィールドおよび設定を参照してくださいにProject Web Appでテンプレートの管理] ページのテンプレートをクリックします。

プロジェクト サーバーのアクセス許可

権限

説明

ManageSecurity

Project Server のセキュリティを管理することができます。グローバル アクセス権。

次の例では、セキュリティ テンプレートを作成し、グローバル グループのAllowに設定されているアクセス許可を追加します。

詳細については、 Securityクラスのメソッドをテストするための基本的なサンプル アプリケーションは、PSI のセキュリティ メソッドを使用してを参照してください。次のコードは、テスト アプリケーションに追加できます。

/*
 * Add this code to the sample application code in the article 
 * Using Security Methods in the PSI.
 */

// Create a GUID for the new template.
Guid templateGuid = Guid.NewGuid();

// Specify basic template information.
SvcSecurity.SecurityTemplatesDataSet templateDs =
   new SvcSecurity.SecurityTemplatesDataSet();
SvcSecurity.SecurityTemplatesDataSet.SecurityTemplatesRow templateRow =
   templateDs.SecurityTemplates.NewSecurityTemplatesRow();
templateRow.WSEC_TMPL_NAME = "SDK Test Template";
templateRow.WSEC_TMPL_UID = templateGuid;
templateRow.WSEC_TMPL_DESC = "This is the SDK Test Template.";
templateDs.SecurityTemplates.AddSecurityTemplatesRow(templateRow);

// Specify a global permission for the template.
SvcSecurity.SecurityTemplatesDataSet.GlobalPermissionsRow globalPermissionRow =
   templateDs.GlobalPermissions.NewGlobalPermissionsRow();
globalPermissionRow.WSEC_TMPL_UID = templateGuid;
// Add a permission that applies to the group. 
// For example, add the "About Microsoft Office Project Server" permission.
globalPermissionRow.WSEC_FEA_ACT_UID =
   PSLibrary.PSSecurityGlobalPermission.AboutMicrosoftOfficeProjectServer;
globalPermissionRow.WSEC_ALLOW = true;
templateDs.GlobalPermissions.AddGlobalPermissionsRow(globalPermissionRow);

// Now that the rows are added to the relevant tables, create the template.
security.CreateTemplates(templateDs);

関連項目

参照先

Security クラス

Security メンバー

WebSvcSecurity 名前空間