Is there a way to tell whether a permission set for a VM is inherited using REST API?

Hi everyone! My question is in the subject for the most part. I'm trying to backup a vm parameters, including the linked attributes, namely the permissions. But I don't want the inherited permissions to be included into the backup, I only need the attributes specific to the vm. It looks like there is no difference between the inherited and the vm-specific permissions in the output from /ovirt-engine/api/vms/<vm-id>/permissions service. What is the best way to distinguish the specific permissions from the inherited ones? It seems I can follow the link to the particular permission and see whether the vm attribute is set on it and it points to the VM I need, but that would require numerous REST requests to be done. Is there a more elegant way? Maybe I can somehow filter the output of /ovirt-engine/api/vms/<vm-id>/permissions to only include the required info? Thanks in advance. Best regards, Anton.

Hi Anton, You can assign permissions to the VM by using the following syntax: POST /ovirt-engine/api/vms/ yyy/permissions <permission> <role> <name> username</name> </role> <user id=" xxx"/> </permission> For further information, you can visit here: http://ovirt.github.io/ovirt-engine-api-model/master/#services/assigned_perm... Hope it helps! *Regards,* *Shani Leviim* On Mon, Apr 22, 2019 at 1:04 PM Anton E <tentaclius@gmail.com> wrote:
Hi everyone!
My question is in the subject for the most part. I'm trying to backup a vm parameters, including the linked attributes, namely the permissions. But I don't want the inherited permissions to be included into the backup, I only need the attributes specific to the vm. It looks like there is no difference between the inherited and the vm-specific permissions in the output from /ovirt-engine/api/vms/<vm-id>/permissions service.
What is the best way to distinguish the specific permissions from the inherited ones? It seems I can follow the link to the particular permission and see whether the vm attribute is set on it and it points to the VM I need, but that would require numerous REST requests to be done. Is there a more elegant way? Maybe I can somehow filter the output of /ovirt-engine/api/vms/<vm-id>/permissions to only include the required info?
Thanks in advance.
Best regards, Anton. _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/AVHAC4SSJWVYYD...

Hi Shani, thanks for your reply. My question is not about assigning permissions, but rather about querying permissions assigned to a given VM. I need to get a list of permissions, assigned to the VM without the permissions this VM inherits from parent objects. Unluckily for me the /ovirt-engine/api/vms/<vm-id>/permissions service returns the list containing both VM-specific and inherited permissions, which cannot be distinguished. Thanks and regards, Anton. On Mon, Apr 22, 2019 at 1:29 PM Shani Leviim <sleviim@redhat.com> wrote:
Hi Anton, You can assign permissions to the VM by using the following syntax:
POST /ovirt-engine/api/vms/ yyy/permissions
<permission> <role> <name> username</name> </role> <user id=" xxx"/> </permission>
For further information, you can visit here: http://ovirt.github.io/ovirt-engine-api-model/master/#services/assigned_perm...
Hope it helps!
*Regards,*
*Shani Leviim*
On Mon, Apr 22, 2019 at 1:04 PM Anton E <tentaclius@gmail.com> wrote:
Hi everyone!
My question is in the subject for the most part. I'm trying to backup a vm parameters, including the linked attributes, namely the permissions. But I don't want the inherited permissions to be included into the backup, I only need the attributes specific to the vm. It looks like there is no difference between the inherited and the vm-specific permissions in the output from /ovirt-engine/api/vms/<vm-id>/permissions service.
What is the best way to distinguish the specific permissions from the inherited ones? It seems I can follow the link to the particular permission and see whether the vm attribute is set on it and it points to the VM I need, but that would require numerous REST requests to be done. Is there a more elegant way? Maybe I can somehow filter the output of /ovirt-engine/api/vms/<vm-id>/permissions to only include the required info?
Thanks in advance.
Best regards, Anton. _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/AVHAC4SSJWVYYD...

Actually this is bug, as I see we fill the <vm > tag for all permissions, even for inherited permissions, but it should be set only for direct permissions, that's how you would distinguish it. Same as you say you can do it via following the specific permission id. So I am afraid there is no effective way, unfortunatelly. If you don't have many users, you can list users permissions and find if it has permission for your VM, which would mean it has direct permission on a VM. On 22/04/2019 12:03, Anton E wrote:
Hi everyone!
My question is in the subject for the most part. I'm trying to backup a vm parameters, including the linked attributes, namely the permissions. But I don't want the inherited permissions to be included into the backup, I only need the attributes specific to the vm. It looks like there is no difference between the inherited and the vm-specific permissions in the output from /ovirt-engine/api/vms/<vm-id>/permissions service.
What is the best way to distinguish the specific permissions from the inherited ones? It seems I can follow the link to the particular permission and see whether the vm attribute is set on it and it points to the VM I need, but that would require numerous REST requests to be done. Is there a more elegant way? Maybe I can somehow filter the output of /ovirt-engine/api/vms/<vm-id>/permissions to only include the required info?
Thanks in advance.
Best regards, Anton. _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/AVHAC4SSJWVYYD...

Hi Ondra, thanks a lot! This info really helps. I will be using the direct link as a workaround for now and will check future versions for the fix. Best regards, Anton. On Tue, Apr 23, 2019 at 10:06 AM Ondra Machacek <omachace@redhat.com> wrote:
Actually this is bug, as I see we fill the <vm > tag for all permissions, even for inherited permissions, but it should be set only for direct permissions, that's how you would distinguish it. Same as you say you can do it via following the specific permission id.
So I am afraid there is no effective way, unfortunatelly. If you don't have many users, you can list users permissions and find if it has permission for your VM, which would mean it has direct permission on a VM.
Hi everyone!
My question is in the subject for the most part. I'm trying to backup a vm parameters, including the linked attributes, namely the permissions. But I don't want the inherited permissions to be included into the backup, I only need the attributes specific to the vm. It looks like there is no difference between the inherited and the vm-specific
On 22/04/2019 12:03, Anton E wrote: permissions in the output from /ovirt-engine/api/vms/<vm-id>/permissions service.
What is the best way to distinguish the specific permissions from the
inherited ones? It seems I can follow the link to the particular permission and see whether the vm attribute is set on it and it points to the VM I need, but that would require numerous REST requests to be done. Is there a more elegant way? Maybe I can somehow filter the output of /ovirt-engine/api/vms/<vm-id>/permissions to only include the required info?
Thanks in advance.
Best regards, Anton. _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/AVHAC4SSJWVYYD...

Hi Ondra, sorry, one more question. Do you know if the bug already exists for this issue? If so, could you please provide the link? Otherwise, should we open a bugzilla item for this? Thanks and regards, Anton. On Tue, Apr 23, 2019 at 10:25 AM Tentaclius <tentaclius@gmail.com> wrote:
Hi Ondra,
thanks a lot! This info really helps. I will be using the direct link as a workaround for now and will check future versions for the fix.
Best regards, Anton.
On Tue, Apr 23, 2019 at 10:06 AM Ondra Machacek <omachace@redhat.com> wrote:
Actually this is bug, as I see we fill the <vm > tag for all permissions, even for inherited permissions, but it should be set only for direct permissions, that's how you would distinguish it. Same as you say you can do it via following the specific permission id.
So I am afraid there is no effective way, unfortunatelly. If you don't have many users, you can list users permissions and find if it has permission for your VM, which would mean it has direct permission on a VM.
Hi everyone!
My question is in the subject for the most part. I'm trying to backup a vm parameters, including the linked attributes, namely the permissions. But I don't want the inherited permissions to be included into the backup, I only need the attributes specific to the vm. It looks like there is no difference between the inherited and the vm-specific
On 22/04/2019 12:03, Anton E wrote: permissions in the output from /ovirt-engine/api/vms/<vm-id>/permissions service.
What is the best way to distinguish the specific permissions from the
inherited ones? It seems I can follow the link to the particular permission and see whether the vm attribute is set on it and it points to the VM I need, but that would require numerous REST requests to be done. Is there a more elegant way? Maybe I can somehow filter the output of /ovirt-engine/api/vms/<vm-id>/permissions to only include the required info?
Thanks in advance.
Best regards, Anton. _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct:
https://www.ovirt.org/community/about/community-guidelines/
List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/AVHAC4SSJWVYYD...
participants (4)
-
Anton E
-
Ondra Machacek
-
Shani Leviim
-
Tentaclius