Project

Profile

Help

Issue #399

closed

Add to 'update role' section that it is possible to update permissions field

Added by ipanova@redhat.com about 9 years ago. Updated almost 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.6.0
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Documentation, Pulp 2
Sprint:
Quarter:

Description

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:

+ This bug was cloned from Bugzilla Bug #1066022 +

Actions #2

Updated by rbarlow about 9 years ago

This is fixed in 2.4.4-0.1.beta.

+ This comment was cloned from Bugzilla #1066022 comment 2 +

Actions #3

Updated by igulina@redhat.com about 9 years ago

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 comment was cloned from Bugzilla #1066022 comment 3 +

Actions #4

Updated by ipanova@redhat.com about 9 years ago

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?

+ This comment was cloned from Bugzilla #1066022 comment 4 +

Actions #5

Updated by skarmark@redhat.com about 9 years ago

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.

+ This comment was cloned from Bugzilla #1066022 comment 5 +

Actions #6

Updated by igulina@redhat.com about 9 years ago

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

+ This comment was cloned from Bugzilla #1066022 comment 6 +

Actions #8

Updated by cduryee about 9 years ago

merged to 2.6-testing and up

+ This comment was cloned from Bugzilla #1066022 comment 8 +

Actions #9

Updated by cduryee about 9 years ago

fixed in 2.6.0-0.4.beta

+ This comment was cloned from Bugzilla #1066022 comment 9 +

Actions #10

Updated by bmbouter about 9 years ago

  • Category deleted (1)
  • Tags Documentation added

Documentation is now a Tag not a Category.

Actions #11

Updated by bmbouter about 9 years ago

  • Severity changed from Medium to 2. Medium
Actions #12

Updated by rbarlow almost 9 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #14

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF