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

Vererbung von Lese- und Schreibrechten in CW

Closes #2102 and #2094

Merge request studip/studip!1360
parent 2a8091c0
No related branches found
No related tags found
No related merge requests found
......@@ -81,8 +81,8 @@ class StructuralElementsCreate extends JsonApiController
'title' => self::arrayGet($json, 'data.attributes.title', ''),
'purpose' => self::arrayGet($json, 'data.attributes.purpose', $parent->purpose),
'payload' => self::arrayGet($json, 'data.attributes.payload', ''),
'read_approval' => self::arrayGet($json, 'data.attributes.read-approval', []),
'write_approval' => self::arrayGet($json, 'data.attributes.write-approval', []),
'read_approval' => $parent->read_approval,
'write_approval' => $parent->write_approval,
'position' => $parent->countChildren()
]);
......
......@@ -837,6 +837,8 @@ SQL;
'position' => $parent->countChildren(),
'payload' => $this->payload,
'image_id' => $file_ref_id,
'read_approval' => $parent->read_approval,
'write_approval' => $parent->write_approval
]);
$element->store();
......@@ -944,6 +946,8 @@ SQL;
'purpose' => $this->purpose,
'position' => $parent->countChildren(),
'payload' => $this->payload,
'read_approval' => $parent->read_approval,
'write_approval' => $parent->write_approval
]);
$element->store();
......
......@@ -1518,8 +1518,6 @@ export default {
const title = this.newChapterName; // this is the title of the new element
const purpose = this.newChapterPurpose;
let parent_id = this.currentId; // new page is descandant as default
let writeApproval = this.currentElement.attributes['write-approval'];
let readApproval = this.currentElement.attributes['read-approval'];
this.errorEmptyChapterName = title.trim();
if (this.errorEmptyChapterName === '') {
......@@ -1527,16 +1525,12 @@ export default {
}
if (this.newChapterParent === 'sibling') {
parent_id = this.structuralElement.relationships.parent.data.id;
writeApproval = [];
readApproval = [];
}
this.showElementAddDialog(false);
this.createStructuralElement({
attributes: {
title: title,
purpose: purpose,
'write-approval': writeApproval,
'read-approval': readApproval
},
templateId: this.newChapterTemplate ? this.newChapterTemplate.id : null,
parentId: parent_id,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment