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

fix #1044

Closes #1044

Merge request studip/studip!610
parent 01573d08
No related branches found
No related tags found
No related merge requests found
......@@ -52,7 +52,19 @@ class Authority
public static function canUpdateBlock(User $user, Block $resource)
{
if ($resource->isBlocked()) {
return $resource->getBlockerUserId() == $user->id;
$structural_element = $resource->container->structural_element;
if ($structural_element->range_type === 'user') {
return $structural_element->range_id === $user->id;
}
$perm = $GLOBALS['perm']->have_studip_perm(
$structural_element->course->config->COURSEWARE_EDITING_PERMISSION,
$structural_element->course->id,
$user->id
);
return $resource->edit_blocker_id === $user->id || $perm;
}
return self::canUpdateContainer($user, $resource->container);
......
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