29.2. 支持的安全管理 REST API 端点


Security Management REST API 提供了在 Business Central 中管理组、角色、用户和权限的端点。它包括使用 Business Central 中的 Security Management 页面执行的安全性和权限管理任务。

29.2.1. 组

安全管理 REST API 支持以下端点来管理 Business Central 中的组。安全管理 REST API 基本 URL 是 http://SERVER:PORT/business-central/rest/。所有请求都需要对 admin 用户角色进行 HTTP 基本身份验证或基于令牌的身份验证。

[GET] /groups

返回 Business Central 中的所有组。

服务器响应示例(JSON)

[
  	{
		"group1"
	},
	{
		"group2"
	}
]
Copy to Clipboard Toggle word wrap

[POST] /groups

在 Business Central 中创建组。组必须至少分配一个用户。

Expand
表 29.1. 请求参数
名称描述类型要求

正文(body)

分配给新组的组名称和用户

请求正文

必填

请求正文示例(JSON)

{
  "name": "groupName",
  "users": [
    "userNames"
  ]
}
Copy to Clipboard Toggle word wrap

服务器响应示例(JSON)

{
  "status": "OK",
  "message": "Group newGroup is created successfully."
}
Copy to Clipboard Toggle word wrap

[DELETE] /groups/{groupName}

从 Business Central 中删除指定的组。

Expand
表 29.2. 请求参数
名称描述类型要求

groupName

要删除的组名称

字符串

必填

服务器响应示例(JSON)

{
  "status": "OK",
  "message": "Group newGroup is deleted successfully."
}
Copy to Clipboard Toggle word wrap

29.2.2. 角色

安全管理 REST API 支持以下端点来管理 Business Central 中的角色。安全管理 REST API 基本 URL 是 http://SERVER:PORT/business-central/rest/。所有请求都需要对 admin 用户角色进行 HTTP 基本身份验证或基于令牌的身份验证。

[GET] /roles

返回 Business Central 中的所有角色。

服务器响应示例(JSON)

[
  {
    "name": "process-admin"
  },
  {
    "name": "manager"
  },
  {
    "name": "admin"
  }
]
Copy to Clipboard Toggle word wrap

29.2.3. 用户

安全管理 REST API 支持以下端点来管理 Business Central 中的用户。安全管理 REST API 基本 URL 是 http://SERVER:PORT/business-central/rest/。所有请求都需要对 admin 用户角色进行 HTTP 基本身份验证或基于令牌的身份验证。

[GET] /users

返回 Business Central 中的所有用户。

服务器响应示例(JSON)

[
    "newUser",
    "user1",
    "user2",
]
Copy to Clipboard Toggle word wrap

[GET] /users/{userName}/groups

返回分配给指定用户的所有组。

Expand
表 29.3. 请求参数
名称描述类型要求

userName

您要检索分配组的用户名称

字符串

必填

服务器响应示例(JSON)

[
  	{
		"group1"
	},
	{
		"group2"
	}
]
Copy to Clipboard Toggle word wrap

[GET] /users/{userName}/roles

返回分配给指定用户的所有角色。

Expand
表 29.4. 请求参数
名称描述类型要求

userName

您要检索分配的角色的用户名称

字符串

必填

服务器响应示例(JSON)

[
  {
    "name": "process-admin"
  },
  {
    "name": "manager"
  },
  {
    "name": "admin"
  }
]
Copy to Clipboard Toggle word wrap

[POST] /users

创建具有指定角色和组的指定用户。

请求正文示例(JSON)

{
  "name": "newUser",
  "roles": [
    "admin",
    "developer"
  ],
  "groups": [
    "group1",
    "group2"
  ]
}
Copy to Clipboard Toggle word wrap

服务器响应示例(JSON)

{
  "status": "OK",
  "message": "User newUser is created successfully."
}
Copy to Clipboard Toggle word wrap

[Post] /users/{userName}/changePassword

更改指定用户的密码。

Expand
表 29.5. 请求参数
名称描述类型要求

userName

您更改密码的用户名称

字符串

必填

request 命令示例

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
Copy to Clipboard Toggle word wrap

服务器响应示例(JSON)

{
  "status": "OK",
  "message": "Password for newUser has been updated successfully."
}
Copy to Clipboard Toggle word wrap

[DELETE] /users/{userName}

从 Business Central 中删除指定用户。

Expand
表 29.6. 请求参数
名称描述类型要求

userName

要删除的用户名称

字符串

必填

服务器响应示例(JSON)

{
  "status": "OK",
  "message": "User newUser is deleted successfully."
}
Copy to Clipboard Toggle word wrap

[POST] /users/{userName}/groups

覆盖分配给具有新组的指定用户的现有组。

Expand
表 29.7. 请求参数
名称描述类型要求

userName

您要更新组的用户名称

字符串

必填

请求正文示例(JSON)

[
  "newGroup"
]
Copy to Clipboard Toggle word wrap

服务器响应示例(JSON)

{
  "status": "OK",
  "message": "Groups [newGroup] are assigned successfully to user wbadmin"
}
Copy to Clipboard Toggle word wrap

[POST] /users/{userName}/roles

覆盖分配给具有新角色的指定用户的现有角色。

Expand
表 29.8. 请求参数
名称描述类型要求

userName

您要更新角色的用户名称

字符串

必填

请求正文示例(JSON)

[
  "admin"
]
Copy to Clipboard Toggle word wrap

服务器响应示例(JSON)

{
  "status": "OK",
  "message": "Roles [admin] are assigned successfully to user wbadmin"
}
Copy to Clipboard Toggle word wrap

29.2.4. 权限

Security Management REST API 支持以下端点来管理对 Business Central 中的组、角色和用户授予权限。安全管理 REST API 基本 URL 是 http://SERVER:PORT/business-central/rest/。所有请求都需要对 admin 用户角色进行 HTTP 基本身份验证或基于令牌的身份验证。

[GET] /groups/{groupName}/permissions

返回授予指定组的所有权限。

Expand
表 29.9. 请求参数
名称描述类型要求

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
	}
}
Copy to Clipboard Toggle word wrap

[GET] /roles/{roleName}/permissions

返回授予指定角色的所有权限。

Expand
表 29.10. 请求参数
名称描述类型要求

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
	}
}
Copy to Clipboard Toggle word wrap

[GET] /users/{userName}/permissions

返回授予指定用户的所有权限。

Expand
表 29.11. 请求参数
名称描述类型要求

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
	}
}
Copy to Clipboard Toggle word wrap

[post] /groups/{groupName}/permissions

更新指定组的权限。

Expand
表 29.12. 请求参数
名称描述类型要求

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
  }
}
Copy to Clipboard Toggle word wrap

服务器响应示例(JSON)

{
  "status": "OK",
  "message": "Group newGroup permissions are updated successfully."
}
Copy to Clipboard Toggle word wrap

[post] /roles/{roleName}/permissions

更新指定角色的权限。

Expand
表 29.13. 请求参数
名称描述类型要求

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
	}
}
Copy to Clipboard Toggle word wrap

服务器响应示例(JSON)

{
  "status": "OK",
  "message": "Role newRole permissions are updated successfully."
}
Copy to Clipboard Toggle word wrap

29.2.4.1. Business Central 支持的权限

以下是 Red Hat Process Automation Manager 中可用的权限。管理员使用这些权限来允许在 Business Central 中对组、角色或用户进行特定操作。

优先级

优先级是一个整数,用于定义分配多个角色或组的用户的优先级。新组的默认值为 -100。在 Business Central 中,您可以将整数值设置为优先级,这使用以下规则解析:

Expand
表 29.14. 优先级值表
整数值优先级

小于 -5

非常低

-5 到 0

等于 0

NORMAL

0 到 5 之间

HIGH

大于 5

非常高

主页
主页表示用户的默认登录页面。
workbench

工作台由以下定义的权限组成:

{
  "editDataObject": true,
  "plannerAvailable": true,
  "editGlobalPreferences": true,
  "editProfilePreferences": true,
  "accessDataTransfer": true,
  "jarDownload": true,
  "editGuidedDecisionTableColumns": true
}
Copy to Clipboard Toggle word wrap
页面、编辑器、Spaces 和项目

以下是根据资源类型的权限可能的值:

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

您可以使用以下代码在 PagesEditorSpacesProjects 权限中添加例外:

{
  "pages": {
    "read": false,
    "exceptions": [
      {
        "resourceName": "ProcessInstances",
        "permissions": {
          "read": false
        }
      },
      {
        "resourceName": "ProcessDefinitions",
        "permissions": {
          "read": false
        }
      }
    ]
  }
}
Copy to Clipboard Toggle word wrap

name 属性是您添加为异常的资源的标识符。使用以下 REST API 端点获取可能标识符列表。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
		}
	}
]
}
Copy to Clipboard Toggle word wrap

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2026 Red Hat
返回顶部