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
61493ce6
Commit
61493ce6
authored
8 years ago
by
srosse
Browse files
Options
Downloads
Patches
Plain Diff
OO-2618: check permission only if message exists
parent
f0f30163
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/olat/search/service/indexer/repository/course/FOCourseNodeIndexer.java
+12
-10
12 additions, 10 deletions
...ervice/indexer/repository/course/FOCourseNodeIndexer.java
with
12 additions
and
10 deletions
src/main/java/org/olat/search/service/indexer/repository/course/FOCourseNodeIndexer.java
+
12
−
10
View file @
61493ce6
...
...
@@ -86,17 +86,19 @@ public class FOCourseNodeIndexer extends ForumIndexer implements CourseNodeIndex
ContextEntry
ce
=
businessControl
.
popLauncherContextEntry
();
Long
resourceableId
=
ce
.
getOLATResourceable
().
getResourceableId
();
Message
message
=
ForumManager
.
getInstance
().
loadMessage
(
resourceableId
);
Message
threadtop
=
message
.
getThreadtop
();
if
(
threadtop
==
null
)
{
threadtop
=
message
;
if
(
message
!=
null
)
{
Message
threadtop
=
message
.
getThreadtop
();
if
(
threadtop
==
null
)
{
threadtop
=
message
;
}
boolean
isMessageHidden
=
Status
.
getStatus
(
threadtop
.
getStatusCode
()).
isHidden
();
//assumes that if is owner then is moderator so it is allowed to see the hidden forum threads
//TODO: (LD) fix this!!! - the contextEntry is not the right context for this check
boolean
isOwner
=
BaseSecurityManager
.
getInstance
().
isIdentityPermittedOnResourceable
(
identity
,
Constants
.
PERMISSION_ACCESS
,
contextEntry
.
getOLATResourceable
());
if
(
isMessageHidden
&&
!
isOwner
)
{
return
false
;
}
}
boolean
isMessageHidden
=
Status
.
getStatus
(
threadtop
.
getStatusCode
()).
isHidden
();
//assumes that if is owner then is moderator so it is allowed to see the hidden forum threads
//TODO: (LD) fix this!!! - the contextEntry is not the right context for this check
boolean
isOwner
=
BaseSecurityManager
.
getInstance
().
isIdentityPermittedOnResourceable
(
identity
,
Constants
.
PERMISSION_ACCESS
,
contextEntry
.
getOLATResourceable
());
if
(
isMessageHidden
&&
!
isOwner
)
{
return
false
;
}
return
super
.
checkAccess
(
contextEntry
,
businessControl
,
identity
,
roles
);
}
...
...
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