Story #210
closedAdd an example how to retrieve permissions for a particular resource
0%
Description
++ This bug was initially created as a clone of Bugzilla Bug #1021970 ++
Description of problem:
Description of problem:
Cannot retrieve permissions for a particular resource, meanwhile docs says it should be possible.
Version-Release number of selected component (if applicable):
How reproducible:
Always
Steps to Reproduce:
1. Retrieve permissions on a particular resource
Actual results:
Permissions on a specified resource not retrieved
Expected results:
Permissions on a specified resource retrieved
Additional info:
Listing permissions for all resources:
- http --verify=no https://admin:admin@pulp.example.com/pulp/api/v2/permissions/
HTTP/1.1 200 OK
Content-Length: 1121
Content-Type: application/json
Date: Tue, 22 Oct 2013 12:20:26 GMT
Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
[
{
"_id": {
"$oid": "525546d2da892d073367960f"
},
"_ns": "permissions",
"id": "525546d2da892d073367960f",
"resource": "/v2/users/admin/",
"users": {
"admin": [
"READ",
"UPDATE"
]
}
},
{
"_id": {
"$oid": "525d34abda892d07336798e1"
},
"_ns": "permissions",
"id": "525d34abda892d07336798e1",
"resource": "/v2/tasks/aa0ef267-7bd3-482d-876c-2bf602b4b5f1/",
"users": {
"admin": [
null,
null
]
}
},
{
"_id": {
"$oid": "525d35edda892d07336798f4"
},
"_ns": "permissions",
"id": "525d35edda892d07336798f4",
"resource": "/v2/tasks/ee25189f-1f16-41ca-b065-fd2f7b5fabac/",
"users": {
"admin": [
null,
null
]
}
},
{
"_id": {
"$oid": "525546d2da892d073367960d"
},
"_ns": "permissions",
"id": "525546d2da892d073367960d",
"resource": "/v2/actions/login/",
"users": {
"admin": [
"READ",
"UPDATE"
]
}
},
{
"_id": {
"$oid": "525546d2da892d073367960e"
},
"_ns": "permissions",
"id": "525546d2da892d073367960e",
"resource": "/v2/actions/logout/",
"users": {
"admin": [
"READ",
"UPDATE"
]
}
},
{
"_id": {
"$oid": "525546d2da892d0733679610"
},
"_ns": "permissions",
"id": "525546d2da892d0733679610",
"resource": "/",
"users": {
"admin": [
"CREATE",
"READ",
"UPDATE",
"DELETE",
"EXECUTE"
]
}
}
]
Using the id of the resource:
- http --verify=no https://admin:admin@pulp.example.com/pulp/api/v2/permissions/525546d2da892d0733679610/
HTTP/1.1 404 Not Found
Content-Type: text/html; charset=UTF-8
Date: Tue, 22 Oct 2013 12:22:20 GMT
Server: Apache/2.4.6 (Fedora) OpenSSL/1.0.1e-fips mod_wsgi/3.4 Python/2.7.5
Transfer-Encoding: chunked
not found
--- Additional comment from ipanova@redhat.com at 11/14/2014 15:06:31 ---
It actually works:
- curl
H "Accept: application/json" -X GET -k -u admin:admin 'https://localhost/pulp/api/v2/permissions/?resource=%2Fv2%2Factions%2Flogin%2F' | python -m json.tool:--:-- --:--:-- --:--:-- 474
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 210 100 177 100 33 473 88 -
[
{
"_id": {
"$oid": "54660ade6754762ed6e6bd38"
},
"_ns": "permissions",
"id": "54660ade6754762ed6e6bd38",
"resource": "/v2/actions/login/",
"users": {
"admin": [
"READ",
"UPDATE"
]
}
}
]
I think an example how to do it would be helpful.
--- Additional comment from ipanova@redhat.com at 11/18/2014 15:15:33 ---
https://github.com/pulp/pulp/pull/1317
--- Additional comment from cduryee@redhat.com at 11/19/2014 23:26:34 ---
This commit is in master and 2.6-dev, changing state to MODIFIED and setting target release.
--- Additional comment from cduryee@redhat.com at 12/23/2014 20:52:57 ---
fixed in pulp 2.6.0-0.2.beta
--- Additional comment from igulina@redhat.com at 01/14/2015 09:45:05 ---
Documented.
Updated by bmbouter about 9 years ago
- Category deleted (
1) - Tags Documentation added
Documentation is now a Tag not a Category.
Updated by rbarlow almost 9 years ago
- Status changed from 6 to CLOSED - CURRENTRELEASE