Skip to content
Snippets Groups Projects
Commit 7b872489 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Ron Lucke
Browse files

prevent warning in CourseWare\StructuralElement::hasEditingPermission(), fixes #2070

Closes #2070

Merge request studip/studip!1346
parent eb09fdeb
No related branches found
No related tags found
No related merge requests found
......@@ -373,9 +373,9 @@ class StructuralElement extends \SimpleORMap
*/
public function hasEditingPermission($user): bool
{
return $GLOBALS['perm']->have_perm('root', $user->id) ||
$GLOBALS['perm']->have_studip_perm(
\CourseConfig::get($this->range_id)->COURSEWARE_EDITING_PERMISSION[$this->getCoursewareCourse($this->range_id)->id],
return $GLOBALS['perm']->have_perm('root', $user->id)
|| $GLOBALS['perm']->have_studip_perm(
\CourseConfig::get($this->range_id)->COURSEWARE_EDITING_PERMISSION[$this->getCoursewareCourse($this->range_id)->id] ?? 'tutor',
$this->range_id,
$user->id
);
......@@ -661,7 +661,7 @@ class StructuralElement extends \SimpleORMap
$root = $this->findAncestors()[0];
}
return Unit::findOneBySQL('structural_element_id = ?', [$root->id]);
return Unit::findOneBySQL('structural_element_id = ?', [$root->id]);
}
/**
......
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