29.2. サポート対象の Security Management REST API エンドポイント

Security Management REST API は、Business Central でグループ、ロール、ユーザー、およびパーミッションを管理するためのエンドポイントを提供します。これには、管理者が Business Central の Security Management ページでも実行できるセキュリティーおよびパーミッション管理タスクが含まれます。

29.2.1. Groups

Security Management REST API は Business Central のグループを管理するための以下のエンドポイントをサポートします。Security Management REST API のベース URL は http://SERVER:PORT/business-central/rest/ です。ユーザーロール admin では、すべての要求で HTTP Basic 認証またはトークンベースの認証が必要です。

[GET] /groups

Business Central のすべてのグループを返します。

サーバーの応答例 (JSON)

[
  	{
		"group1"
	},
	{
		"group2"
	}
]

[POST] /groups

Business Central でグループを作成します。グループには、少なくともユーザーを 1 つ割り当てる必要があります。

表29.1 要求パラメーター

Name説明タイプ要件

ボディ

新しいグループに割り当てられたグループとユーザーの名前

要求ボディ

必須

要求ボディ (JSON) 例

{
  "name": "groupName",
  "users": [
    "userNames"
  ]
}

サーバーの応答例 (JSON)

{
  "status": "OK",
  "message": "Group newGroup is created successfully."
}

[DELETE] /groups/{groupName}

Business Central から指定のグループを削除します。

表29.2 要求パラメーター

Name説明タイプ要件

groupName

削除するグループの名前

文字列

必須

サーバーの応答例 (JSON)

{
  "status": "OK",
  "message": "Group newGroup is deleted successfully."
}

29.2.2. ロール

Security Management REST API は Business Central のロールを管理するための以下のエンドポイントをサポートします。Security Management REST API のベース URL は http://SERVER:PORT/business-central/rest/ です。ユーザーロール admin では、すべての要求で HTTP Basic 認証またはトークンベースの認証が必要です。

[GET] /roles

Business Central のすべてのロールを返します。

サーバーの応答例 (JSON)

[
  {
    "name": "process-admin"
  },
  {
    "name": "manager"
  },
  {
    "name": "admin"
  }
]

29.2.3. ユーザー

Security Management REST API は Business Central のユーザーを管理するための以下のエンドポイントをサポートします。Security Management REST API のベース URL は http://SERVER:PORT/business-central/rest/ です。ユーザーロール admin では、すべての要求で HTTP Basic 認証またはトークンベースの認証が必要です。

[GET] /users

Business Central のすべてのユーザーを返します。

サーバーの応答例 (JSON)

[
    "newUser",
    "user1",
    "user2",
]

[GET] /users/{userName}/groups

指定のユーザーに割り当てられている全グループを返します。

表29.3 要求パラメーター

Name説明タイプ要件

userName

割り当てられたグループを取得するユーザーの名前

文字列

必須

サーバーの応答例 (JSON)

[
  	{
		"group1"
	},
	{
		"group2"
	}
]

[GET] /users/{userName}/roles

指定のユーザーに割り当てられている全ロールを返します。

表29.4 要求パラメーター

Name説明タイプ要件

userName

割り当てられたロールを取得するユーザーの名前

文字列

必須

サーバーの応答例 (JSON)

[
  {
    "name": "process-admin"
  },
  {
    "name": "manager"
  },
  {
    "name": "admin"
  }
]

[POST] /users

ロールとグループを指定して、指定のユーザーを作成します。

要求ボディ (JSON) 例

{
  "name": "newUser",
  "roles": [
    "admin",
    "developer"
  ],
  "groups": [
    "group1",
    "group2"
  ]
}

サーバーの応答例 (JSON)

{
  "status": "OK",
  "message": "User newUser is created successfully."
}

[Post] /users/{userName}/changePassword

指定のユーザーのパスワードを変更します。

表29.5 要求パラメーター

Name説明タイプ要件

userName

パスワードを変更するユーザーの名前

文字列

必須

要求のコマンド例

curl -u 'baAdmin:password@1' -H "Accept: application/json" -H "Content-Type: application/json" -X POST "http://localhost:8080/business-central/rest/users/newUser/changePassword" -d newpassword

サーバーの応答例 (JSON)

{
  "status": "OK",
  "message": "Password for newUser has been updated successfully."
}

[DELETE] /users/{userName}

Business Central から指定のユーザーを削除します。

表29.6 要求パラメーター

Name説明タイプ要件

userName

削除するユーザーの名前

文字列

必須

サーバーの応答例 (JSON)

{
  "status": "OK",
  "message": "User newUser is deleted successfully."
}

[POST] /users/{userName}/groups

指定のユーザーに割り当てられている既存のグループを、新規グループで上書きします。

表29.7 要求パラメーター

Name説明タイプ要件

userName

グループを更新するユーザーの名前

文字列

必須

要求ボディ (JSON) 例

[
  "newGroup"
]

サーバーの応答例 (JSON)

{
  "status": "OK",
  "message": "Groups [newGroup] are assigned successfully to user wbadmin"
}

[POST] /users/{userName}/roles

指定のユーザーに割り当てられている既存のロールを、新規ロールで上書きします。

表29.8 要求パラメーター

Name説明タイプ要件

userName

ロールを更新するユーザーの名前

文字列

必須

要求ボディ (JSON) 例

[
  "admin"
]

サーバーの応答例 (JSON)

{
  "status": "OK",
  "message": "Roles [admin] are assigned successfully to user wbadmin"
}

29.2.4. パーミッション

Security Management REST API は Business Central のグループ、ロール、およびユーザーに割り当てられたパーミッションを管理するための以下のエンドポイントをサポートします。Security Management REST API のベース URL は http://SERVER:PORT/business-central/rest/ です。ユーザーロール admin では、すべての要求で HTTP Basic 認証またはトークンベースの認証が必要です。

[GET] /groups/{groupName}/permissions

指定のグループに付与されている全パーミッションを返します。

表29.9 要求パラメーター

Name説明タイプ要件

groupName

パーミッションを取得するグループの名前

文字列

必須

サーバーの応答例 (JSON)

{
	"homePage": "HomePerspective",
	"priority": -10,
	"project": {
		"read": {
			"access": false,
			"exceptions": []
		},

	},
	"spaces": {
		"read": {
			"access": true,
			"exceptions": [
				"MySpace"
			]
		},
	},
	"editor": {
		"read": {
			"access": false,
			"exceptions": [
				"GuidedDecisionTreeEditorPresenter"
			]
		},
		"create": null,
		"update": null,
		"delete": null,
		"build": null
	},
	"pages": {
		"read": {
			"access": true,
			"exceptions": []
		},
		"build": null
	},
	"workbench": {
		"editDataObject": false,
		"plannerAvailable": false,
		"editGlobalPreferences": false,
		"editProfilePreferences": false,
		"accessDataTransfer": false,
		"jarDownload": true,
		"editGuidedDecisionTableColumns": true
	}
}

[GET] /roles/{roleName}/permissions

指定のロールに付与されている全パーミッションを返します。

表29.10 要求パラメーター

Name説明タイプ要件

roleName

パーミッションを取得するロールの名前

文字列

必須

サーバーの応答例 (JSON)

{
	"homePage": "HomePerspective",
	"priority": -10,
	"project": {
		"read": {
			"access": false,
			"exceptions": []
		},

	},
	"spaces": {
		"read": {
			"access": true,
			"exceptions": [
				"MySpace"
			]
		},
	},
	"editor": {
		"read": {
			"access": false,
			"exceptions": [
				"GuidedDecisionTreeEditorPresenter"
			]
		},
		"create": null,
		"update": null,
		"delete": null,
		"build": null
	},
	"pages": {
		"read": {
			"access": true,
			"exceptions": []
		},
		"build": null
	},
	"workbench": {
		"editDataObject": false,
		"plannerAvailable": false,
		"editGlobalPreferences": false,
		"editProfilePreferences": false,
		"accessDataTransfer": false,
		"jarDownload": true,
		"editGuidedDecisionTableColumns": true
	}
}

[GET] /users/{userName}/permissions

指定のユーザーに付与されている全パーミッションを返します。

表29.11 要求パラメーター

Name説明タイプ要件

userName

パーミッションを取得するユーザーの名前

文字列

必須

サーバーの応答例 (JSON)

{
	"homePage": null,
	"priority": null,
	"project": {
		"read": {
			"access": false,
			"exceptions": []
		},

	},
	"spaces": {
		"read": {
			"access": true,
			"exceptions": [
				"MySpace"
			]
		},
	},
	"editor": {
		"read": {
			"access": false,
			"exceptions": [
				"GuidedDecisionTreeEditorPresenter"
			]
		},
		"create": null,
		"update": null,
		"delete": null,
		"build": null
	},
	"pages": {
		"read": {
			"access": true,
			"exceptions": []
		},
		"build": null
	},
	"workbench": {
		"editDataObject": false,
		"plannerAvailable": false,
		"editGlobalPreferences": false,
		"editProfilePreferences": false,
		"accessDataTransfer": false,
		"jarDownload": true,
		"editGuidedDecisionTableColumns": true
	}
}

[Post] /groups/{groupName}/permissions

指定したグループのパーミッションを更新します。

表29.12 要求パラメーター

Name説明タイプ要件

groupName

パーミッションを更新するグループの名前

文字列

必須

要求ボディ (JSON) 例

{
  "homepage": "HomePerspective",
  "priority": 10,
  "pages": {
    "create": true,
    "read": false,
    "delete": false,
    "update": false,
    "exceptions": [
      {
        "name": "HomePerspective",
        "permissions": {
          "read": true
        }
      }
    ]
  },
  "project": {
    "create": true,
    "read": true,
    "delete": false,
    "update": false,
    "Build": false
  },
  "spaces": {
    "create": true,
    "read": true,
    "delete": false,
    "update": false
  },
  "editor": {
    "read": true
  },
  "workbench": {
    "editDataObject": true,
    "plannerAvailable": true,
    "editGlobalPreferences": true,
    "editProfilePreferences": true,
    "accessDataTransfer": true,
    "jarDownload": true,
    "editGuidedDecisionTableColumns": true
  }
}

サーバーの応答例 (JSON)

{
  "status": "OK",
  "message": "Group newGroup permissions are updated successfully."
}

[Post] /roles/{roleName}/permissions

指定のロールのパーミッションを更新します。

表29.13 要求パラメーター

Name説明タイプ要件

roleName

パーミッションを更新するロールの名前

文字列

必須

要求ボディ (JSON) 例

{
	"homepage": "HomePerspective",
	"priority": 10,
	"pages": {
		"create": true,
		"read": false,
		"delete": false,
		"update": false,
		"exceptions": [{
			"name": "HomePerspective",
			"permissions": {
				"read": true
			}
		}]
	},
	"project": {
		"create": true,
		"read": true,
		"delete": false,
		"update": false,
		"Build": false
	},
	"spaces": {
		"create": true,
		"read": true,
		"delete": false,
		"update": false
	},
	"editor": {
		"read": true
	},
	"workbench": {
		"editDataObject": true,
		"plannerAvailable": true,
		"editGlobalPreferences": true,
		"editProfilePreferences": true,
		"accessDataTransfer": true,
		"jarDownload": true,
		"editGuidedDecisionTableColumns": true
	}
}

サーバーの応答例 (JSON)

{
  "status": "OK",
  "message": "Role newRole permissions are updated successfully."
}

29.2.4.1. Business Central でサポートされているパーミッション

Red Hat Process Automation Manager で使用できるパーミッションは次のとおりです。管理者はこれらのパーミッションを使用して、Business Central のグループ、ロール、またはユーザーに特定のアクションを許可します。

優先順位

優先順位は、複数のロールまたはグループを割り当てられたユーザーの優先度を定義する整数です。新規グループの優先順位のデフォルト値は -100 です。Business Central で優先順位として整数値を設定できます。優先順位は、以下のルールを使用して解決されます。

表29.14 優先順位値のテーブル

整数値優先順位

-5 未満

非常に低い

-5 から 0

0 相当

普通

0 から 5

5 以上

非常に高い

ホームページ
ホームページは、ユーザーのデフォルトのランディングページを示します。
ワークベンチ

ワークベンチは、以下の定義済みのパーミッションで設定されます。

{
  "editDataObject": true,
  "plannerAvailable": true,
  "editGlobalPreferences": true,
  "editProfilePreferences": true,
  "accessDataTransfer": true,
  "jarDownload": true,
  "editGuidedDecisionTableColumns": true
}
ページ、エディター、スペース、およびプロジェクト

以下は、リソースタイプに基にしたパーミッションで使用可能な値です。

  • PAGES: read,create,update,delete
  • EDITOR: read
  • SPACES: read,create,update,delete
  • PROJECT: read,create,update,delete,build

以下のコードを使用して、パーミッション PagesEditorSpaces、および Projects に例外を追加できます。

{
  "pages": {
    "read": false,
    "exceptions": [
      {
        "resourceName": "ProcessInstances",
        "permissions": {
          "read": false
        }
      },
      {
        "resourceName": "ProcessDefinitions",
        "permissions": {
          "read": false
        }
      }
    ]
  }
}

name 属性は、例外として追加するリソースの ID です。以下の REST API エンドポイントを使用して、使用可能な ID 一覧を取得します。REST API ベースの URL は http://SERVER:PORT/business-central/rest/ です。

  • [GET] /perspectives: Business Central での全ページのパースペクティブ名を返します。
  • [GET] /editors: Business Central の全エディターを返します。
  • [GET] /spaces: Business Central の全スペースを返します。
  • [GET] /spaces/{spaceName}/projects: 指定のスペースのプロジェクトを返します。

ページのサーバー応答の例 (JSON)

"pages": {
	"create": true,
	"read": false,
	"exceptions": [
    {
		"name": "HomePerspective",
		"permissions": {
			"read": true
		}
	}
]
}