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