Bug 1354463

Summary: Cannot add a permission for a vmPool to a user via API v4
Product: [oVirt] ovirt-engine Reporter: sefi litmanovich <slitmano>
Component: RestAPIAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Lucie Leistnerova <lleistne>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.0.0CC: bugs, lleistne, lsvaty
Target Milestone: ovirt-4.0.2Keywords: Regression, ZStream
Target Release: 4.0.2Flags: rule-engine: ovirt-4.0.z+
rule-engine: blocker+
rule-engine: planning_ack+
juan.hernandez: devel_ack+
rule-engine: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-12 14:25:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Virt RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description sefi litmanovich 2016-07-11 11:42:42 UTC
Description of problem:

Trying to add to some user a permission for a vm pool, e.g. userRole permission, fails with error message:

<fault>
<detail>
Permission [dataCenter|cluster|host|storageDomain|vm|vmpool|template.id] required for add
</detail>
<reason>Incomplete parameters</reason>
</fault>

Trying to add the same permission to a different entity, e.g. to a cluster, works fine.

Version-Release number of selected component (if applicable):
rhevm-4.0.2-0.2.rc1.el7ev.noarch

How reproducible:
always

Steps to Reproduce:
1. Create a vm pool.
2. Add a user to your system or just use user admin.
3. With api v4 try to add userRole permission to the user's permissions collection e.g.:

URL = https://{engine}/ovirt-engine/api/users/{user_id}/permissions
body:

<permission>
    <role href="/ovirt-engine/api/roles/00000000-0000-0000-0001-000000000001" id="00000000-0000-0000-0001-000000000001">
        <name>UserRole</name>
        <description>Standard User Role</description>
        <link href="/ovirt-engine/api/roles/00000000-0000-0000-0001-000000000001/permits" rel="permits"/>
        <administrative>false</administrative>
        <mutable>false</mutable>
    </role>
    <vm_pool href="/ovirt-engine/api/vmpools/{pool_id}" id="{pool_id}">....
    ...{full vm_pool xml}...
 </vm_pool>
</permission>

Actual results:
POST call fails with:

<fault>
<detail>
Permission [dataCenter|cluster|host|storageDomain|vm|vmpool|template.id] required for add
</detail>
<reason>Incomplete parameters</reason>
</fault>

Expected results:
permission is added to the user successfully 

Additional info:
No interesting information in engine.log

Comment 1 Red Hat Bugzilla Rules Engine 2016-07-11 11:57:27 UTC
This bug report has Keywords: Regression or TestBlocker.
Since no regressions or test blockers are allowed between releases, it is also being identified as a blocker for this release. Please resolve ASAP.

Comment 2 Lucie Leistnerova 2016-08-12 10:36:20 UTC
permission to vmpool added successfully

verified in ovirt-engine-restapi-4.0.2.6-0.1.el7ev.noarch