Edit Role

To edit a role, use the following request:

PUT /roles/:id.xml
PUT /roles/:id.json

XML Request Example

curl -i -X PUT -u user:userpass -H 'Accept: application/xml' -H 'Content-type: application/xml' -d '<role><label>changed</label><permission_ids type="array"><permissions_id>12</permissions_id><permissions_id>14</permissions_id><permissions_id>6</permissions_id><permissions_id>1</permissions_id></permission_ids></role>' --url http://onapp.test/roles/2.xml 

JSON Request Example

curl -i -X PUT -u user:userpass -H 'Accept: application/json' -H 'Content-type: application/json' -d '{"role":{"label":"jsonchanged","permission_ids":[1,2,3,4,5,6,7,8,9]}}' --url http://onapp.test/roles/2.json

Where:

label – role title

permission_ids – ID of permissions, which you want to assign to this role