Skip to content

Commit

Permalink
SAK-33560
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjmerono authored and jonespm committed Feb 14, 2018
1 parent bf7dddc commit c2225c7
Showing 1 changed file with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9014,31 +9014,32 @@ public boolean getHasTopicAccessPrivileges(String topicIdStr){
return false;
}
boolean hasOverridingPermissions = false;
if(SecurityService.isSuperUser()
|| isInstructor()){
if(SecurityService.isSuperUser()){
return true;
}

DiscussionTopic topic = forumManager.getTopicById(topicId);
if(topic == null){
return false;
}
if(userId.equals(topic.getCreatedBy())){
return true;
}

DiscussionForum forum = forumManager.getForumById(topic.getBaseForum().getId());
if(forum == null){
return false;
}
Area area = forumManager.getDiscussionForumArea();
if(area == null){

Area currentArea = forumManager.getDiscussionForumArea();
Area forumArea = forum.getArea();
if(forumArea == null || currentArea == null || !forumArea.getId().equals(currentArea.getId()) ){
return false;
}

return !topic.getDraft() && !forum.getDraft()
&& topic.getAvailability()
&& forum.getAvailability()
&& area.getAvailability();
return isInstructor()
|| userId.equals(topic.getCreatedBy())
|| (!topic.getDraft() && !forum.getDraft()
&& topic.getAvailability()
&& forum.getAvailability()
&& currentArea.getAvailability());
}

public String getServerUrl() {
Expand Down

0 comments on commit c2225c7

Please sign in to comment.