Add computed property for permission check
This commit is contained in:
parent
046599af81
commit
a9de457e35
|
|
@ -10,7 +10,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="content-block__visibility">
|
<div class="content-block__visibility">
|
||||||
<visibility-action
|
<visibility-action
|
||||||
v-if="!contentBlock.indent && editModule"
|
v-if="canEditModule"
|
||||||
:block="contentBlock"></visibility-action>
|
:block="contentBlock"></visibility-action>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -25,8 +25,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<add-content-button :after="contentBlock"
|
<add-content-button :after="contentBlock" v-if="canEditModule"></add-content-button>
|
||||||
v-if="!contentBlock.indent && editModule"></add-content-button>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -104,16 +103,19 @@
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapGetters(['editModule']),
|
...mapGetters(['editModule']),
|
||||||
|
canEditModule() {
|
||||||
|
return !this.contentBlock.indent && this.editModule;
|
||||||
|
},
|
||||||
specialClass() {
|
specialClass() {
|
||||||
return `content-block--${this.contentBlock.type.toLowerCase()}`
|
return `content-block--${this.contentBlock.type.toLowerCase()}`;
|
||||||
},
|
},
|
||||||
instrumentLabel() {
|
instrumentLabel() {
|
||||||
const contentType = this.contentBlock.type.toLowerCase()
|
const contentType = this.contentBlock.type.toLowerCase();
|
||||||
if (!(contentType in instruments)) {
|
if (!(contentType in instruments)) {
|
||||||
return ''
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return `Instrument - ${instruments[contentType]}`
|
return `Instrument - ${instruments[contentType]}`;
|
||||||
},
|
},
|
||||||
canEditContentBlock() {
|
canEditContentBlock() {
|
||||||
return this.contentBlock.mine && !this.contentBlock.indent;
|
return this.contentBlock.mine && !this.contentBlock.indent;
|
||||||
|
|
@ -159,7 +161,7 @@
|
||||||
contentList = [];
|
contentList = [];
|
||||||
return newContents;
|
return newContents;
|
||||||
} else {
|
} else {
|
||||||
return [...newContents, content]
|
return [...newContents, content];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, []);
|
}, []);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue