| 1234567891011121314151617181920212223242526272829 |
- import {ItemMenu, ItemsMenu} from "~/types/interfaces";
- import BaseMenu from "~/use/layout/Menus/baseMenu";
- class AccountMenu extends BaseMenu{
- private $ability:any;
- private $store:any;
- constructor($config:any, $ability:any, $store: any) {
- super($config)
- this.$ability = $ability
- this.$store = $store
- }
- /**
- * Construit le menu Header Configuration ou null si aucune page accessible
- * @return {ItemMenu | null}
- */
- getHeaderMenu():ItemMenu | null {
- const children:ItemsMenu = [];
- if (this.$ability().can('display', 'organization_page')) {
- children.push(this.constructMenu('organization_page', undefined,'/organization/edit'))
- }
- return children.length > 0 ? this.constructMenu('configuration', 'fa-user', undefined, undefined, children) : null;
- }
- }
- export const getAccountMenu = ($config:any, $ability:any, $store:any) => new AccountMenu($config, $ability, $store).getHeaderMenu()
|