Skip to content
Snippets Groups Projects
Commit 43d00d76 authored by srosse's avatar srosse
Browse files

OO-2038: add upload access rule in briefcase course element if the element use...

OO-2038: add upload access rule in briefcase course element if the element use a shared folder which is not read-only
parent 065f4adf
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ import org.olat.course.ICourse;
import org.olat.course.assessment.AssessmentHelper;
import org.olat.course.condition.Condition;
import org.olat.course.condition.ConditionEditController;
import org.olat.course.config.CourseConfig;
import org.olat.course.editor.NodeEditController;
import org.olat.course.nodes.BCCourseNode;
import org.olat.course.run.userview.UserCourseEnvironment;
......@@ -106,7 +107,9 @@ public class BCCourseNodeEditController extends ActivateableTabbableDefaultContr
.getAssessableNodes(course.getEditorTreeModel(), bcNode));
listenTo(uploaderCondContr);
if(bcNode.getModuleConfiguration().getStringValue(CONFIG_SUBPATH, "").startsWith("/_sharedfolder")){
CourseConfig courseConfig = course.getCourseConfig();
if(bcNode.getModuleConfiguration().getStringValue(CONFIG_SUBPATH, "").startsWith("/_sharedfolder")
&& courseConfig.isSharedFolderReadOnlyMount()) {
accessabiliryContent.contextPut("uploadable", false);
} else {
accessabiliryContent.contextPut("uploadable", true);
......
......@@ -102,10 +102,14 @@ public class BCCourseNodeRunController extends DefaultController implements Acti
noFolder = true;
BCCourseNodeNoFolderForm noFolderForm = new BCCourseNodeNoFolderForm(ureq, getWindowControl());
setInitialComponent(noFolderForm.getInitialComponent());
}else if(item instanceof VFSContainer){
} else if(item instanceof VFSContainer){
target = new NamedContainerImpl(courseNode.getShortTitle(), (VFSContainer) item);
}
scallback = new FolderNodeReadOnlyCallback(nodefolderSubContext);
if(courseEnv.getCourseConfig().isSharedFolderReadOnlyMount()) {
scallback = new FolderNodeReadOnlyCallback(nodefolderSubContext);
} else {
scallback = new FolderNodeCallback(BCCourseNode.getNodeFolderContainer(courseNode, courseEnv).getRelPath(), ne, isOlatAdmin, isGuestOnly, nodefolderSubContext);
}
} else{
//create folder automatically if not found
String subPath = courseNode.getModuleConfiguration().getStringValue(BCCourseNodeEditController.CONFIG_SUBPATH);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment