Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OLAT CI-CD Testing Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Oliver Dam
OLAT CI-CD Testing Project
Commits
cb5e6a9a
Commit
cb5e6a9a
authored
8 years ago
by
gnaegi
Browse files
Options
Downloads
Patches
Plain Diff
OO-1988 don't show course resource folders to learners
parent
37781e11
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/org/olat/course/ICourse.java
+5
-4
5 additions, 4 deletions
src/main/java/org/olat/course/ICourse.java
src/main/java/org/olat/course/MergedCourseContainer.java
+18
-10
18 additions, 10 deletions
src/main/java/org/olat/course/MergedCourseContainer.java
with
23 additions
and
14 deletions
src/main/java/org/olat/course/ICourse.java
+
5
−
4
View file @
cb5e6a9a
...
...
@@ -85,9 +85,10 @@ public interface ICourse extends OLATResourceable {
public
OlatRootFolderImpl
getCourseBaseContainer
();
/**
* Return the container to the coursefolder of this course.
* (E.g. "COURSEBASEPATH/coursefolder/"). This is for administration
* use. There is no permission check.
* Return the container to the coursefolder of this course. (E.g.
* "COURSEBASEPATH/coursefolder/"). !! This is for administration or
* internal use!! There is no permission check, make sure your controller
* does check if user is allowed to see stuff, e.g. shared folder
*
* @return the container to the coursefolder of this course
*/
...
...
@@ -95,7 +96,7 @@ public interface ICourse extends OLATResourceable {
/**
* The course folder that the user specified by its identity environment
* can see and use.
* can see and use.
Used by WebDAV access.
*
* @param identityEnv
* @return The aggreagted course folder
...
...
This diff is collapsed.
Click to expand it.
src/main/java/org/olat/course/MergedCourseContainer.java
+
18
−
10
View file @
cb5e6a9a
...
...
@@ -81,11 +81,12 @@ public class MergedCourseContainer extends MergeSource {
protected
void
init
(
PersistingCourseImpl
persistingCourse
)
{
super
.
init
();
RepositoryEntry
re
=
null
;
if
(
identityEnv
==
null
||
identityEnv
.
getRoles
().
isOLATAdmin
())
{
addContainersChildren
(
persistingCourse
.
getIsolatedCourseFolder
(),
true
);
}
else
{
RepositoryEntry
re
=
persistingCourse
.
getCourseEnvironment
().
getCourseGroupManager
().
getCourseEntry
();
re
=
persistingCourse
.
getCourseEnvironment
().
getCourseGroupManager
().
getCourseEntry
();
RepositoryEntrySecurity
reSecurity
=
RepositoryManager
.
getInstance
()
.
isAllowed
(
identityEnv
.
getIdentity
(),
identityEnv
.
getRoles
(),
re
);
if
(
reSecurity
.
isEntryAdmin
())
{
...
...
@@ -93,18 +94,25 @@ public class MergedCourseContainer extends MergeSource {
}
}
// grab any shared folder that is configured
// grab any shared folder that is configured, but only when in unchecked
// security mode (no identity environment) or when the user has course
// admin rights
OlatRootFolderImpl
sharedFolder
=
null
;
String
sfSoftkey
=
persistingCourse
.
getCourseConfig
().
getSharedFolderSoftkey
();
if
(
StringHelper
.
containsNonWhitespace
(
sfSoftkey
)
&&
!
CourseConfig
.
VALUE_EMPTY_SHAREDFOLDER_SOFTKEY
.
equals
(
sfSoftkey
))
{
OLATResource
sharedResource
=
CoreSpringFactory
.
getImpl
(
RepositoryService
.
class
)
.
loadRepositoryEntryResourceBySoftKey
(
sfSoftkey
);
if
(
sharedResource
!=
null
)
{
sharedFolder
=
SharedFolderManager
.
getInstance
().
getSharedFolder
(
sharedResource
);
if
(
sharedFolder
!=
null
)
{
sharedFolder
.
setLocalSecurityCallback
(
new
ReadOnlyCallback
());
//add local course folder's children as read/write source and any sharedfolder as subfolder
addContainer
(
new
NamedContainerImpl
(
"_sharedfolder"
,
sharedFolder
));
if
(
re
==
null
)
{
// reuse if already loaded, else load
re
=
persistingCourse
.
getCourseEnvironment
().
getCourseGroupManager
().
getCourseEntry
();
}
if
(
identityEnv
==
null
||
identityEnv
.
getRoles
().
isOLATAdmin
()
||
RepositoryManager
.
getInstance
().
isOwnerOfRepositoryEntry
(
identityEnv
.
getIdentity
(),
re
))
{
OLATResource
sharedResource
=
CoreSpringFactory
.
getImpl
(
RepositoryService
.
class
).
loadRepositoryEntryResourceBySoftKey
(
sfSoftkey
);
if
(
sharedResource
!=
null
)
{
sharedFolder
=
SharedFolderManager
.
getInstance
().
getSharedFolder
(
sharedResource
);
if
(
sharedFolder
!=
null
)
{
sharedFolder
.
setLocalSecurityCallback
(
new
ReadOnlyCallback
());
//add local course folder's children as read/write source and any sharedfolder as subfolder
addContainer
(
new
NamedContainerImpl
(
"_sharedfolder"
,
sharedFolder
));
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment