无法向SoftLayer用户ID添加权限 [英] Failed to add permission to a SoftLayer user ID

查看:153
本文介绍了无法向SoftLayer用户ID添加权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

curl -D - -X POST -d @permissionSLUser.in.json -o "permissionSLUser.out.json"
"https://someuser:somepassword@api.softlayer.com/rest/v3/SoftLayer_User_Customer/1234/addPortalPermission.json"

.in.json 包含:

 { "parameters": [ { "key": "T_1" } ] }

permissionSLUser.out.json 包含:


错误:您不能将父级不具有
的权限添加到此帐户。,code:SoftLayer_Exception_Public

"error":"You may not add permissions that the parent does not possess to this account.","code":"SoftLayer_Exception_Public"

更新1

1234的父项拥有T_1权限,因此我不明白为什么我收到此权限错误。

I am certain that the parent of 1234 has T_1 permission, so I don't understand why I am getting this permission error.

有人会有任何想法为什么吗?感谢。

Would anyone have any idea why? Thanks.

推荐答案

请使用keyname $ c>key。

Please use "keyname" instead of "key".

这是一个休息示例:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_User_Customer/[user_id]/addPortalPermission

Method: POST

Json:

{
  "parameters": [
    {
      "keyName": "TICKET_VIEW"
    }
  ]
}

要获得所有可用的权限,请查看: SoftLayer_User_Customer_CustomerPermission_Permission :: getAllObjects

To get all available permissions, please review: SoftLayer_User_Customer_CustomerPermission_Permission::getAllObjects

如果您要使用 SoftLayer_User_Customer :: addBulkPortalPermission ,请尝试以下操作REST请求:

If you want to use SoftLayer_User_Customer::addBulkPortalPermission, please try the following REST request:

网址:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_User_Customer/[User_Id]/addBulkPortalPermission

方法:POST

Json有效负载:

{
  "parameters": [
    [
      {
        "keyName": "TICKET_VIEW"
      }
    ]
  ]
}

注意:在这种情况下,注意配置有2个方​​括号 : ...:[[{keyName:...

Note: In this case, notice that the configuration has 2 "square bracket": ...": [[{"keyName":...

我希望他们能帮助你。

I hope them help you.

这篇关于无法向SoftLayer用户ID添加权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆