in json array names are singular eg. permissions should be

 "permission":
       [ { "role-name": "reader", "capability": "read" },
         { "role-name": "writer", "capability": "read" },
         { "role-name": "writer", "capability": "update" } ]
________________________________________
From: [email protected] 
<[email protected]> on behalf of Florent Georges 
<[email protected]>
Sent: 28 November 2017 00:15:18
To: MarkLogic Developer Discussion
Subject: [MarkLogic Dev General] Management API: 400 on creating a role with    
permissions

Hi,

I send a POST to /manage/v2/roles with the following content:

    { "role-name": "writer",
      "description": "Test role 2.",
      "permissions":
       [ { "role-name": "reader", "capability": "read" },
         { "role-name": "writer", "capability": "read" },
         { "role-name": "writer", "capability": "update" } ] }

But I receive a 400 back with the following content:

    MANAGE-INVALIDPAYLOAD: (err:FOER0000) Payload has errors in
    structure, content-type or values. Unexpected element: role-name
    (not in schema)

The following request succeeds (with no permissions property):

    { "role-name": "reader",
      "description": "Test role 1." }

Did I miss something in https://docs.marklogic.com/REST/POST/manage/v2/roles?

Regards,

--
Florent Georges
H2O Consulting
http://h2o.consulting/


_______________________________________________
General mailing list
[email protected]
Manage your subscription at: 
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to