SoftLayer(IBM Cloud Infrastructure)API具有大量的权限,其名称如下:
{'keyName': 'ACCESS_ALL_GUEST', 'name': 'All Guest Access'}
或
{'keyName': 'SERVER_ADD', 'name': 'Add Server'}
所有这些都可以使用API调用进行检索
client['SoftLayer_User_Customer_CustomerPermission_Permission'].getAllObjects()
但是,我找不到允许用户执行任何给定功能所需的权限交叉引用。例如,“添加服务器”是否仅需要订购裸机服务器?可能有人认为这是不言自明的,但是很多/大多数并不是那么明显。
有这样的交叉引用吗?到目前为止,我们只能依靠猜测并尝试添加一些东西,直到操作成功为止。
答案 0 :(得分:1)
您可以使用SoftLayer_User_Permission_Action::getAllObjects 这不是一个交叉引用,但是您将获得您希望使用的权限的描述,响应将是一组权限,如下所示:
{
"createDate": null,
"description": "Add new servers to the account.",
"id": 1267,
"key": "XX_1",
"keyName": "SERVER_ADD",
"modifyDate": null,
"name": "Add Server"
},
{
"createDate": null,
"description": "Modify the account and company profile associated with this account.",
"id": 1268,
"key": "A_2",
"keyName": "COMPANY_EDIT",
"modifyDate": null,
"name": "Edit Company Profile"
},
{
"createDate": null,
"description": "Upgrade any servers on the account.",
"id": 1269,
"key": "A_5",
"keyName": "SERVER_UPGRADE",
"modifyDate": null,
"name": "Upgrade Server"
},