29
29
</li >
30
30
</ul >
31
31
<!-- Edit Options -->
32
- <ul class =" menu-section" >
32
+ <ul class =" menu-section" v-bind:class = " { disabled: !isEditAllowed } " >
33
33
<li class =" section-title" >
34
34
{{ $t('context-menus.item.options-section-title') }}
35
35
</li >
@@ -85,6 +85,9 @@ export default {
85
85
isEditMode () {
86
86
return this .$store .state .editMode ;
87
87
},
88
+ isEditAllowed () {
89
+ return this .$store .getters .permissions .allowViewConfig ;
90
+ },
88
91
},
89
92
methods: {
90
93
/* Called on item click, emits an event up to Item */
@@ -93,13 +96,19 @@ export default {
93
96
this .$emit (' launchItem' , target);
94
97
},
95
98
openSettings () {
96
- this .$emit (' openItemSettings' );
99
+ if (this .isEditAllowed ) {
100
+ this .$emit (' openItemSettings' );
101
+ }
97
102
},
98
103
openMoveMenu () {
99
- this .$emit (' openMoveItemMenu' );
104
+ if (this .isEditAllowed ) {
105
+ this .$emit (' openMoveItemMenu' );
106
+ }
100
107
},
101
108
openDeleteItem () {
102
- this .$emit (' openDeleteItem' );
109
+ if (this .isEditAllowed ) {
110
+ this .$emit (' openDeleteItem' );
111
+ }
103
112
},
104
113
},
105
114
};
@@ -149,6 +158,13 @@ div.context-menu {
149
158
path { fill : currentColor ; }
150
159
}
151
160
}
161
+ & .disabled li :not (.section-title ) {
162
+ cursor : not-allowed ;
163
+ opacity : var (--dimming-factor );
164
+ & :hover {
165
+ background : var (--context-menu-background );
166
+ }
167
+ }
152
168
}
153
169
}
154
170
0 commit comments