Search in sources :

Example 1 with UniquePermissionsSet

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);
    }
}
Also used : UniquePermissionsSet(org.ovirt.engine.core.bll.UniquePermissionsSet) Permission(org.ovirt.engine.core.common.businessentities.Permission)

Aggregations

UniquePermissionsSet (org.ovirt.engine.core.bll.UniquePermissionsSet)1 Permission (org.ovirt.engine.core.common.businessentities.Permission)1