Skip to content

Commit

Permalink
SAK-30270 Add option to enforce uploads via web dave to be hidden
Browse files Browse the repository at this point in the history
- add property content.dav.upload.hidden
  • Loading branch information
ern committed Jan 28, 2016
1 parent 0aac6c8 commit bcc5a36
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,8 @@
# myworkspace.info.url=/library/content/myworkspace_info.html
# webcontent.instructions.url=/library/content/webcontent_instructions.html
# webdav.instructions.url=/library/content/webdav_instructions.html

# Enforce all file uploads to be hidden by default
# content.dav.upload.hidden=false
# The location (url) of the accessibility info
# DEFAULT: ""
# accessibility.url=
Expand Down
4 changes: 4 additions & 0 deletions dav/dav/src/java/org/sakaiproject/dav/DavServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -2790,6 +2790,10 @@ protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws Se
contentType = edit.getContentType();
}

if (contentHostingService.isAvailabilityEnabled()) {
boolean hidden = ServerConfigurationService.getBoolean("content.dav.upload.hidden", false);
edit.setAvailability(hidden, null, null);
}
edit.setContentType(contentType);
edit.setContent(inputStream);

Expand Down

0 comments on commit bcc5a36

Please sign in to comment.