use of org.ovirt.engine.core.common.action.PermissionsOperationsParameters in project ovirt-engine by oVirt.
the class PermissionListModel method onRemove.
private void onRemove() {
if (getSelectedItems() != null && getSelectedItems().size() > 0) {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object perm : getSelectedItems()) {
PermissionsOperationsParameters tempVar = new PermissionsOperationsParameters();
tempVar.setPermission((Permission) perm);
list.add(tempVar);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemovePermission, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
}
use of org.ovirt.engine.core.common.action.PermissionsOperationsParameters in project ovirt-engine by oVirt.
the class SystemPermissionListModel method onRemove.
private void onRemove() {
if (getSelectedItems() != null && getSelectedItems().size() > 0) {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object perm : getSelectedItems()) {
PermissionsOperationsParameters tempVar = new PermissionsOperationsParameters();
tempVar.setPermission((Permission) perm);
list.add(tempVar);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveSystemPermission, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
}
use of org.ovirt.engine.core.common.action.PermissionsOperationsParameters in project ovirt-engine by oVirt.
the class QuotaUserListModel method onRemove.
private void onRemove() {
if (getSelectedItems() != null && getSelectedItems().size() > 0) {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> list = new ArrayList<>();
for (Object perm : getSelectedItems()) {
PermissionsOperationsParameters tempVar = new PermissionsOperationsParameters();
tempVar.setPermission((Permission) perm);
list.add(tempVar);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemovePermission, list, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
cancel();
}
use of org.ovirt.engine.core.common.action.PermissionsOperationsParameters in project ovirt-engine by oVirt.
the class AddCpuProfileCommand method createPermissionParameters.
private PermissionsOperationsParameters createPermissionParameters(Guid userId, Guid roleId) {
Permission permission = new Permission(userId, roleId, getProfileId(), VdcObjectType.CpuProfile);
permission.setObjectName(getParameters().getProfile().getName());
if (MultiLevelAdministrationHandler.EVERYONE_OBJECT_ID.equals(userId)) {
permission.setAuthz("N/A");
}
PermissionsOperationsParameters permissionsOperationsParameters = new PermissionsOperationsParameters(permission);
permissionsOperationsParameters.setParametersCurrentUser(getCurrentUser());
permissionsOperationsParameters.setSessionId(getContext().getEngineContext().getSessionId());
return permissionsOperationsParameters;
}
use of org.ovirt.engine.core.common.action.PermissionsOperationsParameters in project ovirt-engine by oVirt.
the class BackendAssignedPermissionsResource method add.
@Override
public Response add(Permission permission) {
validateParameters(permission, isPrincipalSubCollection() ? new String[] { "role.id|name", "dataCenter|cluster|host|storageDomain|vm|vmPool|template.id" } : new String[] { "role.id|name", "user|group.id" });
PermissionsOperationsParameters parameters = getParameters(permission);
QueryIdResolver<Guid> resolver = new QueryIdResolver<>(QueryType.GetPermissionById, IdQueryParameters.class);
return performCreate(ActionType.AddPermission, parameters, resolver);
}
Aggregations