Skip to content
Snippets Groups Projects
Commit 48dcb499 authored by Ron Lucke's avatar Ron Lucke Committed by Elmar Ludwig
Browse files

fix #2844

Closes #2844

Merge request studip/studip!2006
parent 1403583c
No related branches found
No related tags found
No related merge requests found
......@@ -549,5 +549,9 @@ class Authority
return self::canIndexClipboardsOfAUser($request_user, $user);
}
public static function canInsertFromClipboard(User $user, Clipboard $resource)
{
return $resource->user_id === $user->id;
}
}
......@@ -35,6 +35,11 @@ class ClipboardsInsert extends NonJsonApiController
}
$user = $this->getUser($request);
if (!Authority::canInsertFromClipboard($user, $clipboard)) {
throw new AuthorizationFailedException();
}
$backup = json_decode($clipboard->backup);
if ($clipboard->object_type === 'courseware-blocks') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment