Bug 1550165

Summary: [RFE] /user/{myUserId}/permissions for all users
Product: [oVirt] ovirt-engine Reporter: jniederm
Component: RestAPIAssignee: Ondra Machacek <omachace>
Status: CLOSED CURRENTRELEASE QA Contact: Radim Hrazdil <rhrazdil>
Severity: medium Docs Contact:
Priority: unspecified    
Version: futureCC: bugs, michal.skrivanek, mperina, rhrazdil
Target Milestone: ovirt-4.2.2Keywords: FutureFeature
Target Release: ---Flags: mperina: ovirt-4.2?
michal.skrivanek: blocker?
rhrazdil: testing_plan_complete-
rule-engine: planning_ack?
mperina: devel_ack+
rule-engine: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Previously users using 'Filter: true' HTTP header when querying API resource /ovirt-engine/api/{userid}/permissions, wasn't able to see a list of his/her permissions. This feature allows the users using filtered API see their permissions.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-29 11:09:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1550568    

Description jniederm 2018-02-28 16:51:09 UTC
Description of problem:
It would be nice to have /user/{myUserId}/permissions endpoint available for all (even non-admin) users for VM Portal to be able to properly filter entities and enable/disable UI widgets. This endpoint should contain all (both direct and inherited) permissions.

/user/{myUserId}/permissions endpoint may be better than separate /{entitiesName}/{entityId}/permissions since it can save many requests provided the permissions  will be cached in VM Portal.

Currently (commit u45b0275) request like:

    GET /users/{myUserId}/permissions
    Filter: true

returns <permissions/> for non-admin users.

Comment 1 Radim Hrazdil 2018-03-26 12:44:58 UTC
Verified that /user/{myUserId}/permissions endpoint is avaliable even for non-admin users.

curl -v -u "test1@internal:<passwd>" -H "Content-type: application/json" -H "Filter: true"  --insecure <fqdn>/ovirt-engine/api/users/<test1_userid>/permissions

outputs

<permissions>
    <permission>
        <group href="" id=""/>
        <role href="" id=""/>
    </permission>
    .
    .
    .
</permissions>

instead of 

</permissions>

Version 4.2.2.5-0.1.el7

Comment 2 Sandro Bonazzola 2018-03-29 11:09:57 UTC
This bugzilla is included in oVirt 4.2.2 release, published on March 28th 2018.

Since the problem described in this bug report should be
resolved in oVirt 4.2.2 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.