fix manage menu permissions

This commit is contained in:
garrettmills 2020-02-18 11:56:10 -06:00
parent a463334c94
commit 1edd696bdb

View File

@ -98,11 +98,18 @@ export class AppComponent implements OnInit {
}
async onNodeMenuClick($event) {
console.log(this.menuTarget)
let canManage = this.menuTarget.data.level === 'manage';
if ( !canManage ) {
if ( !this.menuTarget.data.level ) {
canManage = true;
}
}
const popover = await this.popover.create({
component: OptionMenuComponent,
componentProps: {
menuItems: [
...(this.menuTarget.data.level !== 'manage' ? [] : [{name: 'Share Sub-Tree', icon: 'person-add', value: 'share'}]),
...(!canManage ? [] : [{name: 'Share Sub-Tree', icon: 'person-add', value: 'share'}]),
],
},
event: $event,