Skip to content
Snippets Groups Projects
Commit 10c0135d authored by Viktoria Wiebe's avatar Viktoria Wiebe Committed by Jan-Hendrik Willms
Browse files

fix #1047 - add perm check for user context

Closes #1047

Merge request studip/studip!1095
parent 2520e57a
No related branches found
No related tags found
No related merge requests found
......@@ -250,6 +250,10 @@ class Authority
public static function canUpdateBlockComment(User $user, BlockComment $resource)
{
if ($resource->block->container->structural_element->range_type === 'user') {
return $resource->block->container->structural_element->range_id === $user->id;
}
$perm = $GLOBALS['perm']->have_studip_perm(
$resource->block->container->structural_element->course->config->COURSEWARE_EDITING_PERMISSION,
$resource->block->container->structural_element->course->id,
......@@ -371,6 +375,10 @@ class Authority
return true;
}
if ($resource->structural_element->range_type === 'user') {
return $resource->structural_element->range_id === $user->id;
}
$perm = $GLOBALS['perm']->have_studip_perm(
$resource->structural_element->course->config->COURSEWARE_EDITING_PERMISSION,
$resource->structural_element->course->id,
......@@ -396,6 +404,10 @@ class Authority
return true;
}
if ($resource->range_type === 'user') {
return $resource->range_id === $user->id;
}
$perm = $GLOBALS['perm']->have_studip_perm(
$resource->course->config->COURSEWARE_EDITING_PERMISSION,
$resource->course->id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment