Forum Discussion

Bency_Tharakan's avatar
Bency_Tharakan
Icon for Nimbostratus rankNimbostratus
Sep 02, 2015

Setting up RBAC using PATCH method

Hi All,

I'm having trouble adding a user account to a role using PATCH method.

Here is the relevant bit from iControl REST user guide.

To add the user account to the role, use the

PATCH
method and specify the
userReferences
property with the link to the user account in the JSON body.

Here is curl command used:

curl -sk  https://localhost/mgmt/shared/authz/roles/iControl_REST_API_User -H "Content-Type: application/json" -u admin:adminpw -X PATCH -d '{"op": "add", "path":"/userReferences", "value": [{"link": "https://localhost/mgmt/shared/authz/users/user1"}]}' | jq . 

The above command runs without any error, however the userReferences property is not added to iControl_REST_API_User role.

curl -sk  https://localhost/mgmt/shared/authz/roles/iControl_REST_API_User -H "Content-Type: application/json" -u admin:adminpw | jq .

I have trimmed some of the output.

{
  "name": "iControl_REST_API_User",
  "resources": [
    {
      "resourceMask": "/mgmt/tm/wom/*/*/*/*/*/*/*",
      "restMethod": "DELETE"
    },
    {
      "resourceMask": "/mgmt/tm/cm/*/*/*/*/*/*/*/*",
      "restMethod": "GET"
    },
    {
      "resourceMask": "/mgmt/tm/net/*/*",
      "restMethod": "POST"
    },
    {
      "resourceMask": "/mgmt/tm/actions/*/*/*/*/*/*/*",
      "restMethod": "DELETE"
    },
    {
      "resourceMask": "/mgmt/tm/ltm/*/*/*/*/*/*/*",
      "restMethod": "PATCH"
    },
    {
      "resourceMask": "/mgmt/tm/security/*/*/*/*/*/*",
      "restMethod": "PATCH"
    },   

Let me know what I'm missing here Cheers,

Bency