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