Skip to content
Snippets Groups Projects
Commit 83704430 authored by Alex ORLUC's avatar Alex ORLUC
Browse files

FEAT #12003 TIME 0:05 fix current user shortcuts

parent 0ee26a36
No related branches found
No related tags found
No related merge requests found
...@@ -37,7 +37,7 @@ export class MenuShortcutComponent implements OnInit { ...@@ -37,7 +37,7 @@ export class MenuShortcutComponent implements OnInit {
} }
ngOnInit(): void { ngOnInit(): void {
this.shortcuts = this.privilegeService.getShortcuts(); this.shortcuts = this.privilegeService.getCurrentUserShortcuts();
} }
onSpeedDialFabClicked(group: any, shortcut:any) { onSpeedDialFabClicked(group: any, shortcut:any) {
......
...@@ -487,7 +487,7 @@ export class PrivilegeService { ...@@ -487,7 +487,7 @@ export class PrivilegeService {
return this.menus.map(elem => elem.unit).filter((elem, pos, arr) => arr.indexOf(elem) === pos); return this.menus.map(elem => elem.unit).filter((elem, pos, arr) => arr.indexOf(elem) === pos);
} }
getShortcuts(): Array<menu> { getCurrentUserShortcuts(): Array<menu> {
let shortcuts: any[] = [ let shortcuts: any[] = [
{ {
"id": "home", "id": "home",
...@@ -501,7 +501,7 @@ export class PrivilegeService { ...@@ -501,7 +501,7 @@ export class PrivilegeService {
} }
]; ];
shortcuts = shortcuts.concat(this.menus.filter(elem => elem.shortcut === true)); shortcuts = shortcuts.concat(this.menus.filter(elem => elem.shortcut === true).filter(elem => this.headerService.user.privileges.indexOf(elem.id) > -1));
if (this.headerService.user.groups.filter((group: any) => group.can_index === true).length > 0) { if (this.headerService.user.groups.filter((group: any) => group.can_index === true).length > 0) {
const indexingGroups: any[] = []; const indexingGroups: any[] = [];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment