use of org.ovirt.engine.core.bll.UniquePermissionsSet in project ovirt-engine by oVirt.
the class ImportVmCommandBase method addVmPermission.
private void addVmPermission() {
UniquePermissionsSet permissionsToAdd = new UniquePermissionsSet();
if (isMakeCreatorExplicitOwner()) {
permissionsToAdd.addPermission(getCurrentUser().getId(), PredefinedRoles.VM_OPERATOR.getId(), getVmId(), VdcObjectType.VM);
}
if (!permissionsToAdd.isEmpty()) {
List<Permission> permissionsList = permissionsToAdd.asPermissionList();
multiLevelAdministrationHandler.addPermission(permissionsList.toArray(new Permission[permissionsList.size()]));
getCompensationContext().snapshotNewEntities(permissionsList);
}
}
Aggregations