Skip to content
Snippets Groups Projects
Commit bcafbf91 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

Revert "fix #1044"

This reverts commit a9a31a9e.
parent 48e8d6c1
No related branches found
No related tags found
No related merge requests found
...@@ -59,19 +59,13 @@ class Authority ...@@ -59,19 +59,13 @@ class Authority
public static function canUpdateBlock(User $user, Block $resource) public static function canUpdateBlock(User $user, Block $resource)
{ {
if ($resource->isBlocked()) { if ($resource->isBlocked()) {
$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( $perm = $GLOBALS['perm']->have_studip_perm(
$structural_element->course->config->COURSEWARE_EDITING_PERMISSION, $resource->container->structural_element->course->config->COURSEWARE_EDITING_PERMISSION,
$structural_element->course->id, $resource->container->structural_element->course->id,
$user->id $user->id
); );
return $resource->edit_blocker_id === $user->id || $perm; return $resource->getBlockerUserId() == $user->id || $perm;
} }
return self::canUpdateContainer($user, $resource->container); 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