From 1e4682dc566156229d80751675252995d256462e Mon Sep 17 00:00:00 2001 From: XingY Date: Tue, 24 Nov 2026 16:16:48 -0800 Subject: [PATCH 1/4] GH Issue 1809: disallow cross folder delete --- .../api/assay/AssayResultUpdateService.java | 3 +++ .../api/ExpDataClassDataTableImpl.java | 24 +++++++++++++------ .../api/SampleTypeUpdateServiceDI.java | 17 +++++++++++++ 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/assay/api-src/org/labkey/api/assay/AssayResultUpdateService.java b/assay/api-src/org/labkey/api/assay/AssayResultUpdateService.java index 9619e023f3f..b4494438533 100644 --- a/assay/api-src/org/labkey/api/assay/AssayResultUpdateService.java +++ b/assay/api-src/org/labkey/api/assay/AssayResultUpdateService.java @@ -339,6 +339,9 @@ protected Map deleteRow( { ExpRun run = getRun(oldRowMap, user, DeletePermission.class); + if (!container.allowRowMutationForContainer(run.getContainer())) + throw new UnauthorizedException("Assay results being deleted are from a different container."); + AssayService.get().onBeforeAssayResultDelete(container, user, run, oldRowMap); TableInfo datatableInfo = this.getQueryTable(); diff --git a/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java b/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java index c1104f779a7..819f49b0a16 100644 --- a/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java @@ -1427,11 +1427,12 @@ else if (null != lsid) else filter.addCondition(Column.ClassId.fieldKey(), classId) .addCondition(Column.Name.fieldKey(), name); - if (!allowCrossContainer) - filter.addCondition(Column.Folder.fieldKey(), container.getEntityId()); + // exp.data has no Folder column, so the folder scoping goes on a copy and the key-only filter probes exp.data below + SimpleFilter scopedFilter = allowCrossContainer ? filter + : new SimpleFilter(filter).addCondition(Column.Folder.fieldKey(), container.getEntityId()); TableInfo queryTable = getQueryTable(); - TableSelector selector = new TableSelector(queryTable, filter, null); + TableSelector selector = new TableSelector(queryTable, scopedFilter, null); Map dataRow = null; try (var results = selector.getResults()) { @@ -1441,13 +1442,22 @@ else if (null != lsid) } } - if (dataRow == null && allowCrossContainer) + if (dataRow == null) { - // data not found from queryTable but exist in exp.data, which happens when users lack of permission to data's container - if (new TableSelector(ExperimentService.get().getTinfoData(), Collections.singleton(ExpDataTable.Column.RowId.name()), filter, null).exists()) + // data not found from queryTable but exist in exp.data + Map existing = new TableSelector(ExperimentService.get().getTinfoData(), + CaseInsensitiveHashSet.of(ExpDataTable.Column.RowId.name(), "Container"), filter, null).setMaxRows(1).getMap(); + if (existing != null) { String keyDisplay = name != null ? name : (rowId != null ? "{RowId=" + rowId + "}" : lsid); - throw new InvalidKeyException("Data does not exist in " + container.getName() + ": '" + keyDisplay + "'."); + // the caller allowed cross-container, so the row is simply unreadable by this user + if (allowCrossContainer) + throw new InvalidKeyException("Data does not exist in " + container.getName() + ": '" + keyDisplay + "'."); + + // GH Issue 1809: cross-folder rows used to be dropped silently; only report ones the user can read + Container rowContainer = ContainerManager.getForId((String) existing.get("Container")); + if (rowContainer != null && rowContainer.hasPermission(user, getReadPermissionClass())) + throw new UnauthorizedException("Data is from a different folder: " + rowContainer.getPath() + "."); } } diff --git a/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java b/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java index ae54cdfcd84..03a229a9b3c 100644 --- a/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java +++ b/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java @@ -790,6 +790,7 @@ protected Map deleteRow(User user, Container container, Map id = new LinkedList<>(); Long rowId = getMaterialRowId(oldRowMap); + verifyNotCrossFolder(container, oldRowMap); id.add(rowId); ExperimentServiceImpl.get().deleteMaterialByRowIds(user, container, id, true, _sampleType, false, false); return oldRowMap; @@ -821,6 +822,8 @@ public List> deleteRows(User user, Container container, List if (rowId == null) throw new QueryUpdateServiceException("RowID is required to delete a Sample Type Material"); + verifyNotCrossFolder(container, map); + Long sampleStateId = MapUtils.getLong(map, SampleState.name()); if (!SampleStatusService.get().isOperationPermitted(getContainer(), sampleStateId, SampleTypeService.SampleOperations.Delete)) { @@ -873,6 +876,20 @@ public List> deleteRows(User user, Container container, List return MapUtils.getLong(row, RowId.name()); } + /** GH Issue 1809: rows resolve across containers, so the row's own folder must be checked before deleting it. */ + private void verifyNotCrossFolder(Container container, Map row) + { + Object folder = row.get(Folder.name()); + Container rowContainer = switch (folder) + { + case null -> null; + case Container c -> c; + default -> ContainerManager.getForId(folder.toString()); + }; + if (rowContainer != null && !container.allowRowMutationForContainer(rowContainer)) + throw new UnauthorizedException("Samples being deleted are from a different folder: " + rowContainer.getPath() + "."); + } + private @Nullable Filter getMaterialFilter(Map keys, boolean useSampleType) { Long rowId = getMaterialRowId(keys); From 3093196c47aa69086e3c89efbc571291806240b0 Mon Sep 17 00:00:00 2001 From: XingY Date: Tue, 24 Nov 2026 21:55:11 -0800 Subject: [PATCH 2/4] CC review --- .../api/assay/AssayResultUpdateService.java | 3 +- .../api/ExpDataClassDataTableImpl.java | 85 +++++++++++++++---- .../api/SampleTypeUpdateServiceDI.java | 36 ++++++-- 3 files changed, 99 insertions(+), 25 deletions(-) diff --git a/assay/api-src/org/labkey/api/assay/AssayResultUpdateService.java b/assay/api-src/org/labkey/api/assay/AssayResultUpdateService.java index b4494438533..b56a90cb429 100644 --- a/assay/api-src/org/labkey/api/assay/AssayResultUpdateService.java +++ b/assay/api-src/org/labkey/api/assay/AssayResultUpdateService.java @@ -47,6 +47,7 @@ import org.labkey.api.query.FilteredTable; import org.labkey.api.query.InvalidKeyException; import org.labkey.api.query.QueryUpdateServiceException; +import org.labkey.api.query.RuntimeValidationException; import org.labkey.api.query.ValidationException; import org.labkey.api.security.User; import org.labkey.api.security.permissions.DeletePermission; @@ -340,7 +341,7 @@ protected Map deleteRow( ExpRun run = getRun(oldRowMap, user, DeletePermission.class); if (!container.allowRowMutationForContainer(run.getContainer())) - throw new UnauthorizedException("Assay results being deleted are from a different container."); + throw new RuntimeValidationException("Assay results being deleted are from a different container."); AssayService.get().onBeforeAssayResultDelete(container, user, run, oldRowMap); diff --git a/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java b/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java index 819f49b0a16..4e147eba8a0 100644 --- a/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java @@ -1364,6 +1364,67 @@ protected Map getRow(User user, Container container, Map> deleteRows(User user, Container container, List> keys, @Nullable Map configParameters, @Nullable Map extraScriptContext) + throws QueryUpdateServiceException, SQLException, InvalidKeyException, BatchValidationException + { + verifyNoCrossFolderDeletes(user, container, keys); + return super.deleteRows(user, container, keys, configParameters, extraScriptContext); + } + + /** + * GH Issue 1809: getRow() is scoped to the request folder, so a row in another folder would be dropped from the + * delete without a word. Report those rows instead. Delete only -- the shared lookup path keeps its old behavior. + */ + private void verifyNoCrossFolderDeletes(User user, Container container, List> keys) + throws SQLException, BatchValidationException + { + BatchValidationException errors = new BatchValidationException(); + for (int i = 0; i < keys.size(); i++) + { + Map aliased = new CaseInsensitiveHashMap<>(keys.get(i)); + aliasColumns(_columnMapping, aliased); + + Map row; + try + { + row = getDataMap(aliased, user, container, true, false); + } + catch (InvalidKeyException e) + { + continue; // unreadable from here; super.deleteRows skips it as it did before + } + if (null == row) + continue; + + Object folder = row.get(Column.Folder.name()); + Container rowContainer = switch (folder) + { + case null -> null; + case Container c -> c; + default -> ContainerManager.getForId(folder.toString()); + }; + + String error = null; + if (null == rowContainer) + error = "Unable to determine the folder of the data being deleted."; + else if (!container.allowRowMutationForContainer(rowContainer)) + { + // only name a folder the user is allowed to see + String where = rowContainer.hasPermission(user, getReadPermissionClass()) ? rowContainer.getPath() : "another folder"; + error = "Data is from a different folder: " + where + "."; + } + + if (null != error) + { + ValidationException vex = new ValidationException(error); + errors.addRowError(vex.fillIn(getQueryTable().getPublicSchemaName(), getQueryTable().getName(), keys.get(i), i)); + } + } + if (errors.hasErrors()) + throw errors; + } + @Override public List> getRows(User user, Container container, List> keys) throws SQLException, InvalidKeyException @@ -1427,12 +1488,11 @@ else if (null != lsid) else filter.addCondition(Column.ClassId.fieldKey(), classId) .addCondition(Column.Name.fieldKey(), name); - // exp.data has no Folder column, so the folder scoping goes on a copy and the key-only filter probes exp.data below - SimpleFilter scopedFilter = allowCrossContainer ? filter - : new SimpleFilter(filter).addCondition(Column.Folder.fieldKey(), container.getEntityId()); + if (!allowCrossContainer) + filter.addCondition(Column.Folder.fieldKey(), container.getEntityId()); TableInfo queryTable = getQueryTable(); - TableSelector selector = new TableSelector(queryTable, scopedFilter, null); + TableSelector selector = new TableSelector(queryTable, filter, null); Map dataRow = null; try (var results = selector.getResults()) { @@ -1442,22 +1502,13 @@ else if (null != lsid) } } - if (dataRow == null) + if (dataRow == null && allowCrossContainer) { - // data not found from queryTable but exist in exp.data - Map existing = new TableSelector(ExperimentService.get().getTinfoData(), - CaseInsensitiveHashSet.of(ExpDataTable.Column.RowId.name(), "Container"), filter, null).setMaxRows(1).getMap(); - if (existing != null) + // data not found from queryTable but exist in exp.data, which happens when users lack of permission to data's container + if (new TableSelector(ExperimentService.get().getTinfoData(), Collections.singleton(ExpDataTable.Column.RowId.name()), filter, null).exists()) { String keyDisplay = name != null ? name : (rowId != null ? "{RowId=" + rowId + "}" : lsid); - // the caller allowed cross-container, so the row is simply unreadable by this user - if (allowCrossContainer) - throw new InvalidKeyException("Data does not exist in " + container.getName() + ": '" + keyDisplay + "'."); - - // GH Issue 1809: cross-folder rows used to be dropped silently; only report ones the user can read - Container rowContainer = ContainerManager.getForId((String) existing.get("Container")); - if (rowContainer != null && rowContainer.hasPermission(user, getReadPermissionClass())) - throw new UnauthorizedException("Data is from a different folder: " + rowContainer.getPath() + "."); + throw new InvalidKeyException("Data does not exist in " + container.getName() + ": '" + keyDisplay + "'."); } } diff --git a/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java b/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java index 03a229a9b3c..4d5390938bf 100644 --- a/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java +++ b/experiment/src/org/labkey/experiment/api/SampleTypeUpdateServiceDI.java @@ -96,6 +96,7 @@ import org.labkey.api.query.QueryService; import org.labkey.api.query.QueryUpdateService; import org.labkey.api.query.QueryUpdateServiceException; +import org.labkey.api.query.RuntimeValidationException; import org.labkey.api.query.UserSchema; import org.labkey.api.query.ValidationException; import org.labkey.api.reader.ColumnDescriptor; @@ -790,7 +791,9 @@ protected Map deleteRow(User user, Container container, Map id = new LinkedList<>(); Long rowId = getMaterialRowId(oldRowMap); - verifyNotCrossFolder(container, oldRowMap); + String crossFolderError = crossFolderError(container, oldRowMap); + if (crossFolderError != null) + throw new RuntimeValidationException(crossFolderError); id.add(rowId); ExperimentServiceImpl.get().deleteMaterialByRowIds(user, container, id, true, _sampleType, false, false); return oldRowMap; @@ -810,11 +813,14 @@ public List> deleteRows(User user, Container container, List else { List ids = new LinkedList<>(); + BatchValidationException errors = new BatchValidationException(); // Issue 40621 // adding input fields is expensive, skip input fields for delete since deleted samples are not surfaced on Timeline UI - for (Map map : getMaterialMaps(keys)) + List> materialMaps = getMaterialMaps(keys); + for (int i = 0; i < materialMaps.size(); i++) { + Map map = materialMaps.get(i); if (map == null) throw new QueryUpdateServiceException("No Sample Type Material found for RowID or LSID"); @@ -822,7 +828,13 @@ public List> deleteRows(User user, Container container, List if (rowId == null) throw new QueryUpdateServiceException("RowID is required to delete a Sample Type Material"); - verifyNotCrossFolder(container, map); + String crossFolderError = crossFolderError(container, map); + if (crossFolderError != null) + { + ValidationException vex = new ValidationException(crossFolderError); + errors.addRowError(vex.fillIn(getQueryTable().getPublicSchemaName(), getQueryTable().getName(), keys.get(i), i)); + continue; + } Long sampleStateId = MapUtils.getLong(map, SampleState.name()); if (!SampleStatusService.get().isOperationPermitted(getContainer(), sampleStateId, SampleTypeService.SampleOperations.Delete)) @@ -834,6 +846,9 @@ public List> deleteRows(User user, Container container, List ids.add(rowId); result.add(map); } + if (errors.hasErrors()) + throw errors; + // TODO check if this handle attachments??? ExperimentServiceImpl.get().deleteMaterialByRowIds(user, container, ids, true, _sampleType, false, false); } @@ -876,8 +891,12 @@ public List> deleteRows(User user, Container container, List return MapUtils.getLong(row, RowId.name()); } - /** GH Issue 1809: rows resolve across containers, so the row's own folder must be checked before deleting it. */ - private void verifyNotCrossFolder(Container container, Map row) + /** + * GH Issue 1809: rows resolve across containers, so the row's own folder must be checked before deleting it. + * Returns the error, or null when the row may be deleted from this folder. A folder that cannot be resolved is an + * error rather than a pass: this is the check the delete relies on. + */ + private @Nullable String crossFolderError(Container container, Map row) { Object folder = row.get(Folder.name()); Container rowContainer = switch (folder) @@ -886,8 +905,11 @@ private void verifyNotCrossFolder(Container container, Map row) case Container c -> c; default -> ContainerManager.getForId(folder.toString()); }; - if (rowContainer != null && !container.allowRowMutationForContainer(rowContainer)) - throw new UnauthorizedException("Samples being deleted are from a different folder: " + rowContainer.getPath() + "."); + if (rowContainer == null) + return "Unable to determine the folder of the sample being deleted."; + if (!container.allowRowMutationForContainer(rowContainer)) + return "Samples being deleted are from a different folder: " + rowContainer.getPath() + "."; + return null; } private @Nullable Filter getMaterialFilter(Map keys, boolean useSampleType) From c1f6cdf59792829d970002798d269afa457125a8 Mon Sep 17 00:00:00 2001 From: XingY Date: Tue, 24 Nov 2026 22:27:09 -0800 Subject: [PATCH 3/4] CC review --- .../src/org/labkey/assay/AssayController.java | 11 ++- .../api/ExpDataClassDataTableImpl.java | 94 +++++++++++-------- 2 files changed, 67 insertions(+), 38 deletions(-) diff --git a/assay/src/org/labkey/assay/AssayController.java b/assay/src/org/labkey/assay/AssayController.java index 2a92cbb79cb..0041b10ae43 100644 --- a/assay/src/org/labkey/assay/AssayController.java +++ b/assay/src/org/labkey/assay/AssayController.java @@ -1783,6 +1783,7 @@ public Object execute(AssayOperationConfirmationForm form, BindException errors) Collection> dataRows = new TableSelector(tableInfo, PageFlowUtil.set("rowid", "dataid"), filter, null).getMapCollection(); List permittedRowIds = new LongArrayList(); Set uniqueContainers = new HashSet<>(); + Map containersByRowId = new HashMap<>(); for (Map dataRow : dataRows) { Long rowId = MapUtils.getLong(dataRow,"rowid"); @@ -1790,6 +1791,7 @@ public Object execute(AssayOperationConfirmationForm form, BindException errors) if (data == null || data.getRun() == null) continue; Container c = data.getRun().getContainer(); + containersByRowId.put(rowId, c); if (c.hasPermission(getUser(), ReadPermission.class)) uniqueContainers.add(c); if (c.hasPermission(getUser(), AssayRunOperations.Edit.getPermissionClass())) @@ -1804,7 +1806,14 @@ public Object execute(AssayOperationConfirmationForm form, BindException errors) "path", (Object) c.getPath(), "permitted", permClass == null || c.hasPermission(getUser(), permClass) )).toList()); - response.put("allowed", allowedIds.stream().map(id -> Map.of("RowId", id)).toList()); + // GH Issue 1809: the client partitions the delete by ContainerPath; without it every row is sent to the request folder + response.put("allowed", allowedIds.stream().map(id -> { + Map rowMap = new HashMap<>(); + rowMap.put("RowId", id); + Container c = containersByRowId.get(id); + rowMap.put("ContainerPath", c != null && c.hasPermission(getUser(), ReadPermission.class) ? c.getPath() : getContainer().getPath()); + return rowMap; + }).toList()); response.put("notAllowed", new HashSet<>()); response.put("notPermitted", notPermitted); return success(response); diff --git a/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java b/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java index 4e147eba8a0..d6904fb2080 100644 --- a/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java @@ -32,6 +32,7 @@ import org.labkey.api.data.BaseColumnInfo; import org.labkey.api.data.ColumnHeaderType; import org.labkey.api.data.ColumnInfo; +import org.labkey.api.data.CompareType; import org.labkey.api.data.Container; import org.labkey.api.data.ContainerFilter; import org.labkey.api.data.ContainerManager; @@ -1377,54 +1378,73 @@ public List> deleteRows(User user, Container container, List * delete without a word. Report those rows instead. Delete only -- the shared lookup path keeps its old behavior. */ private void verifyNoCrossFolderDeletes(User user, Container container, List> keys) - throws SQLException, BatchValidationException + throws BatchValidationException { - BatchValidationException errors = new BatchValidationException(); - for (int i = 0; i < keys.size(); i++) + Set rowIds = new HashSet<>(); + Set lsids = new HashSet<>(); + Set names = new HashSet<>(); + List keyValues = new ArrayList<>(keys.size()); + for (Map key : keys) { - Map aliased = new CaseInsensitiveHashMap<>(keys.get(i)); + Map aliased = new CaseInsensitiveHashMap<>(key); aliasColumns(_columnMapping, aliased); + Long rowId = (Long) JdbcType.BIGINT.convert(aliased.get(Column.RowId.name())); + String lsid = (String) JdbcType.VARCHAR.convert(aliased.get(Column.LSID.name())); + String name = (String) JdbcType.VARCHAR.convert(aliased.get(Name.name())); + if (null != rowId) + rowIds.add(rowId); + else if (null != lsid) + lsids.add(lsid); + else if (null != name) + names.add(name); + keyValues.add(rowId != null ? rowId : (lsid != null ? lsid : name)); + } - Map row; - try - { - row = getDataMap(aliased, user, container, true, false); - } - catch (InvalidKeyException e) - { - continue; // unreadable from here; super.deleteRows skips it as it did before - } - if (null == row) - continue; + // exp.data carries no container filter, so rows the user cannot read are found here and reported rather than dropped + Map containersByKey = new HashMap<>(); + selectDataContainers(Column.RowId, rowIds, false, containersByKey); + selectDataContainers(Column.LSID, lsids, false, containersByKey); + selectDataContainers(Column.Name, names, true, containersByKey); - Object folder = row.get(Column.Folder.name()); - Container rowContainer = switch (folder) - { - case null -> null; - case Container c -> c; - default -> ContainerManager.getForId(folder.toString()); - }; - - String error = null; - if (null == rowContainer) - error = "Unable to determine the folder of the data being deleted."; - else if (!container.allowRowMutationForContainer(rowContainer)) - { - // only name a folder the user is allowed to see - String where = rowContainer.hasPermission(user, getReadPermissionClass()) ? rowContainer.getPath() : "another folder"; - error = "Data is from a different folder: " + where + "."; - } + BatchValidationException errors = new BatchValidationException(); + for (int i = 0; i < keys.size(); i++) + { + // absent means no such row anywhere, which super.deleteRows already ignores + Container rowContainer = containersByKey.get(keyValues.get(i)); + if (null == rowContainer || container.allowRowMutationForContainer(rowContainer)) + continue; - if (null != error) - { - ValidationException vex = new ValidationException(error); - errors.addRowError(vex.fillIn(getQueryTable().getPublicSchemaName(), getQueryTable().getName(), keys.get(i), i)); - } + // only name a folder the user is allowed to see + String where = rowContainer.hasPermission(user, getReadPermissionClass()) ? rowContainer.getPath() : "another folder"; + ValidationException vex = new ValidationException("Data is from a different folder: " + where + "."); + errors.addRowError(vex.fillIn(getQueryTable().getPublicSchemaName(), getQueryTable().getName(), keys.get(i), i)); } if (errors.hasErrors()) throw errors; } + /** exp.data enforces UNIQUE(classId, name), so every key type resolves to at most one row. */ + private void selectDataContainers(Column keyColumn, Collection values, boolean scopeToDataClass, Map containersByKey) + { + if (values.isEmpty()) + return; + + SimpleFilter filter = new SimpleFilter(FieldKey.fromParts(keyColumn.name()), values, CompareType.IN); + if (scopeToDataClass) + filter.addCondition(FieldKey.fromParts("ClassId"), _dataClass.getRowId()); + + new TableSelector(ExperimentService.get().getTinfoData(), + CaseInsensitiveHashSet.of(keyColumn.name(), "Container"), filter, null) + .forEachMap(row -> { + Container c = ContainerManager.getForId((String) row.get("Container")); + if (null == c) + return; + // exp.data.RowId comes back as Integer; the keys were converted to Long + Object keyValue = Column.RowId == keyColumn ? JdbcType.BIGINT.convert(row.get(keyColumn.name())) : row.get(keyColumn.name()); + containersByKey.put(keyValue, c); + }); + } + @Override public List> getRows(User user, Container container, List> keys) throws SQLException, InvalidKeyException From 53629ab6d8f352089175bd95f1919588953f4ee7 Mon Sep 17 00:00:00 2001 From: XingY Date: Tue, 24 Nov 2026 22:48:54 -0800 Subject: [PATCH 4/4] CC review --- assay/src/org/labkey/assay/AssayController.java | 3 ++- .../org/labkey/experiment/api/ExpDataClassDataTableImpl.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/assay/src/org/labkey/assay/AssayController.java b/assay/src/org/labkey/assay/AssayController.java index 0041b10ae43..0582ceaa4f9 100644 --- a/assay/src/org/labkey/assay/AssayController.java +++ b/assay/src/org/labkey/assay/AssayController.java @@ -1811,7 +1811,8 @@ public Object execute(AssayOperationConfirmationForm form, BindException errors) Map rowMap = new HashMap<>(); rowMap.put("RowId", id); Container c = containersByRowId.get(id); - rowMap.put("ContainerPath", c != null && c.hasPermission(getUser(), ReadPermission.class) ? c.getPath() : getContainer().getPath()); + if (c != null && c.hasPermission(getUser(), ReadPermission.class)) + rowMap.put("ContainerPath", c.getPath()); return rowMap; }).toList()); response.put("notAllowed", new HashSet<>()); diff --git a/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java b/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java index d6904fb2080..0e51089f021 100644 --- a/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java +++ b/experiment/src/org/labkey/experiment/api/ExpDataClassDataTableImpl.java @@ -1411,7 +1411,7 @@ else if (null != name) { // absent means no such row anywhere, which super.deleteRows already ignores Container rowContainer = containersByKey.get(keyValues.get(i)); - if (null == rowContainer || container.allowRowMutationForContainer(rowContainer)) + if (null == rowContainer || container.equals(rowContainer)) continue; // only name a folder the user is allowed to see