Hide Forgot
Description of problem: Current docs mention that only display_name and description of a role can be updated, although it is also possible to update permissions. http://pulp-dev-guide.readthedocs.org/en/latest/integration/rest-api/role/cud.html#update-a-role As you can see: $ curl -H "Accept: application/json" PUT -k -u admin:admin -d '{"delta":{"permissions":{"/":["CREATE"]}}}' 'https://example.com/pulp/api/v2/roles/myrole/' | python -m json.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 230 100 188 100 42 217 48 --:--:-- --:--:-- --:--:-- 248 { "_href": "/pulp/api/v2/roles/myrole/", "_id": { "$oid": "53021345356cdf01fefddd22" }, "_ns": "roles", "description": null, "display_name": "myrole", "id": "myrole", "permissions": { "/": [ "CREATE" ] } } Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
https://github.com/pulp/pulp/pull/1322
This is fixed in 2.4.4-0.1.beta.
I couldn't update permissions. Please let me know what to do about that. >> rpm -qa | grep pulp-server pulp-server-2.4.4-0.1.beta.el7.noarch >> curl -i -H "Accept: application/json" -X POST -k -u admin:admin -d '{"display_name": "Role Test", "description": "Demo Role", "role id": "gena-users"}' 'https://hostname/pulp/api/v2/roles/' HTTP/1.1 201 Created Date: Sun, 07 Dec 2014 16:46:22 GMT Server: Apache/2.4.6 (Red Hat) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 Location: gena-users Content-Length: 200 Content-Type: application/json {"display_name": "Role Test", "description": "Demo Role", "_ns": "roles", "_href": "/pulp/api/v2/roles/gena-users/", "_id": {"$oid": "5484845e21ede105b5f56e39"}, "id": "gena-users", "permissions": {}} >> curl -i -H "Accept: application/json" -X PUT -k -u admin:admin -d '{"delta":{"display_name": "New Role Test", "description": "New Demo Role", "permissions": {"/v2/roles/": ["CREATE"]}}}' 'https://hostname/pulp/api/v2/roles/gena-users/' HTTP/1.1 400 Bad Request Date: Sun, 07 Dec 2014 16:47:49 GMT Server: Apache/2.4.6 (Red Hat) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 Content-Encoding: utf-8 Content-Length: 380 Connection: close Content-Type: application/json {"http_request_method": "PUT", "exception": null, "error_message": "Update Keyword [permissions] is not supported", "_href": "/pulp/api/v2/roles/gena-users/", "http_status": 400, "error": {"code": "PLP0000", "data": {}, "description": "Update Keyword [permissions] is not supported", "sub_errors": []}, "args": ["Update Keyword [permissions] is not supported"], "traceback": null} >> curl -i -H "Accept: application/json" -X PUT -k -u admin:admin -d '{"delta":{"display_name": "New Role Test", "description": "New Demo Role"}}' 'https://hostname/pulp/api/v2/roles/gena-users/' HTTP/1.1 200 OK Date: Sun, 07 Dec 2014 16:48:55 GMT Server: Apache/2.4.6 (Red Hat) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 Content-Length: 208 Content-Type: application/json {"display_name": "New Role Test", "description": "New Demo Role", "_ns": "roles", "_href": "/pulp/api/v2/roles/gena-users/", "_id": {"$oid": "5484845e21ede105b5f56e39"}, "id": "gena-users", "permissions": {}} >> curl -i -H "Accept: application/json" -X PUT -k -u admin:admin -d '{"delta":{"display_name": "New Role Test", "description": "New Demo Role", "permissions": {}}}' 'https://hostname/pulp/api/v2/roles/gena-users/' HTTP/1.1 400 Bad Request Date: Sun, 07 Dec 2014 16:50:33 GMT Server: Apache/2.4.6 (Red Hat) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5 Content-Encoding: utf-8 Content-Length: 380 Connection: close Content-Type: application/json {"http_request_method": "PUT", "exception": null, "error_message": "Update Keyword [permissions] is not supported", "_href": "/pulp/api/v2/roles/gena-users/", "http_status": 400, "error": {"code": "PLP0000", "data": {}, "description": "Update Keyword [permissions] is not supported", "sub_errors": []}, "args": ["Update Keyword [permissions] is not supported"], "traceback": null}
This documentation bug was opened together with https://bugzilla.redhat.com/show_bug.cgi?id=1066040 (api bug), and since api bug was fixed the way it is not possible to update permission field in the role update call - doc bug is not appropriate anymore. Barnaby, what are the next steps regarding this situation?
Ina, Barnaby, that is right. Here is the PR https://github.com/pulp/pulp/pull/820 which summarizes how permissions of a role need to be updated and the way described in this bug is not supported. This change will need to be reverted.
Everything regarding updating permissions in "Update a role" section [1] should be removed since that way of updating permissions is not supported anymore. See comments above. [1] http://pulp-dev-guide.readthedocs.org/en/latest/integration/rest-api/role/cud.html#update-a-role
https://github.com/pulp/pulp/pull/1477
merged to 2.6-testing and up
fixed in 2.6.0-0.4.beta
Moved to https://pulp.plan.io/issues/399