Skip to content
Snippets Groups Projects
Commit 7fef0df3 authored by Ron Lucke's avatar Ron Lucke Committed by Till Glöggler
Browse files

fix #1144

Closes #1144

Merge request studip/studip!855
parent 9bc8e30f
No related branches found
No related tags found
No related merge requests found
...@@ -79,7 +79,7 @@ class StructuralElementsCreate extends JsonApiController ...@@ -79,7 +79,7 @@ class StructuralElementsCreate extends JsonApiController
'editor_id' => $user->id, 'editor_id' => $user->id,
'edit_blocker_id' => '', 'edit_blocker_id' => '',
'title' => self::arrayGet($json, 'data.attributes.title', ''), 'title' => self::arrayGet($json, 'data.attributes.title', ''),
'purpose' => self::arrayGet($json, 'data.attributes.purpose', 'content'), 'purpose' => $parent->purpose,
'payload' => self::arrayGet($json, 'data.attributes.payload', ''), 'payload' => self::arrayGet($json, 'data.attributes.payload', ''),
'position' => $parent->countChildren() 'position' => $parent->countChildren()
]); ]);
......
...@@ -227,20 +227,23 @@ class StructuralElement extends \SimpleORMap ...@@ -227,20 +227,23 @@ class StructuralElement extends \SimpleORMap
case 'course': case 'course':
$hasEditingPermission = $this->hasEditingPermission($user); $hasEditingPermission = $this->hasEditingPermission($user);
if ($this->isTask()) { if ($this->isTask()) {
// TODO: Was tun wir, wenn dieses Strukturelement purpose=task aber keinen Task hat? $task = $this->task;
if (!$this->task) { if (!$task) {
return false; $task = $this->findParentTask();
if (!$task) {
return false;
}
} }
if ($hasEditingPermission) { if ($hasEditingPermission) {
return false; return false;
} }
if ($this->task->isSubmitted()) { if ($task->isSubmitted()) {
return false; return false;
} }
return $this->task->userIsASolver($user); return $task->userIsASolver($user);
} }
if ($hasEditingPermission) { if ($hasEditingPermission) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment