[ovirt-users] Removing all the Users Permission on Data Center

Manuel Luis Aznar manuel.luis.aznar at gmail.com
Wed Feb 22 09:35:04 UTC 2017


Hello,

Sorry but there is a errata in this piece:

u = kvm.users.get(id=userid)
for perm in u.permissions.list():
   udc = perm.get_data_center()
      if udc:
         globaldc = kvm.datacenters.get(id=udc.get_id())
         if globaldc.get_name() == dc:
            perm.delete()

The perm.delete() call is not correct and you need to put the following two
lines:

   permission_service = permissions_service.permission_service(id=
data_center_permission.id)
   permission_service.remove()

Of course you need:

     permissions_service = system_service.permissions_service()

Thanks and sorry for the errata
Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20170222/44dfebe8/attachment.html>


More information about the Users mailing list