fix: navigation with restricted permissions
This commit is contained in:
parent
89bc0f9373
commit
e10bfdd315
6 changed files with 18 additions and 7 deletions
|
@ -33,7 +33,8 @@ export const useAbilityStore = defineStore("ability", {
|
|||
if (type == "admin") return permissions?.admin ?? permissions?.adminByOwner ?? false;
|
||||
if (permissions?.admin || permissions?.adminByOwner) return true;
|
||||
if (
|
||||
(permissions[section]?.all == "*" || permissions[section]?.all?.includes(type)) &&
|
||||
permissions[section]?.all == "*" ||
|
||||
permissions[section]?.all?.includes(type) ||
|
||||
permissions[section] != undefined
|
||||
)
|
||||
return true;
|
||||
|
|
|
@ -37,6 +37,11 @@ export const useNavigationStore = defineStore("navigation", {
|
|||
};
|
||||
},
|
||||
getters: {
|
||||
topLevelObject: (state) =>
|
||||
state.topLevel.map((tl) => ({
|
||||
...tl,
|
||||
levelDefault: state.navigation[tl.key].main.filter((m) => !m.key.includes("divider"))[0]?.key ?? "",
|
||||
})),
|
||||
activeNavigationObject: (state) => (state.navigation[state.activeNavigation] ?? {}) as navigationSplitModel,
|
||||
activeTopLevelObject: (state) =>
|
||||
(state.topLevel.find((elem) => elem.key == state.activeNavigation) ?? {}) as topLevelNavigationModel,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue