diff --git a/api/src/org/labkey/api/action/SpringActionController.java b/api/src/org/labkey/api/action/SpringActionController.java index a53815d0ce6..0ad8524273c 100644 --- a/api/src/org/labkey/api/action/SpringActionController.java +++ b/api/src/org/labkey/api/action/SpringActionController.java @@ -267,14 +267,6 @@ protected static
P urlProvider(Class
inter) return PageFlowUtil.urlProvider(inter); } - protected void requiresLogin() - { - if (getUser().isGuest()) - { - throw new UnauthorizedException(); - } - } - protected ViewBackgroundInfo getViewBackgroundInfo() { ViewContext vc = getViewContext(); diff --git a/specimen/src/org/labkey/specimen/actions/SpecimenApiController.java b/specimen/src/org/labkey/specimen/actions/SpecimenApiController.java index 6559e4e4082..b531e152fab 100644 --- a/specimen/src/org/labkey/specimen/actions/SpecimenApiController.java +++ b/specimen/src/org/labkey/specimen/actions/SpecimenApiController.java @@ -402,22 +402,22 @@ public void setPreferredLocation(Integer preferredLocation) private SpecimenRequest getRequest(User user, Container container, int rowId, boolean checkOwnership, boolean checkEditability) { SpecimenRequest request = SpecimenRequestManager.get().getRequest(container, rowId); - boolean admin = container.hasPermission(user, RequestSpecimensPermission.class); + boolean admin = container.hasPermission(user, ManageRequestsPermission.class); boolean adminOrOwner = request != null && (admin || request.getCreatedBy() == user.getUserId()); if (request == null || (checkOwnership && !adminOrOwner)) - throw new RuntimeException("Request " + rowId + " was not found or the current user does not have permissions to access it."); + throw new IllegalArgumentException("Request " + rowId + " was not found or the current user does not have permissions to access it."); if (checkEditability) { if (admin) { if (SpecimenRequestManager.get().isInFinalState(request)) - throw new RuntimeException("Request " + rowId + " is in a final state and cannot be modified."); + throw new IllegalArgumentException("Request " + rowId + " is in a final state and cannot be modified."); } else { SpecimenRequestStatus cartStatus = SpecimenRequestManager.get().getRequestShoppingCartStatus(container, user); if (cartStatus == null || request.getStatusId() != cartStatus.getRowId()) - throw new RuntimeException("Request " + rowId + " has been submitted and can only be modified by an administrator."); + throw new IllegalArgumentException("Request " + rowId + " has been submitted and can only be modified by an administrator."); } } return request; @@ -616,7 +616,7 @@ public ApiResponse execute(RequestIdForm deleteRequestForm, BindException errors private void buildTypeSummary(List