fix: navigation with restricted permissions
This commit is contained in:
parent
89bc0f9373
commit
e10bfdd315
6 changed files with 18 additions and 7 deletions
|
@ -19,11 +19,16 @@ export async function abilityAndNavUpdate(to: any, from: any, next: any) {
|
|||
navigation.updateNavigation();
|
||||
NProgress.done();
|
||||
next();
|
||||
} else if ((admin && ability.isAdmin()) || ability.can(type, section, module)) {
|
||||
} else if (module && ((admin && ability.isAdmin()) || ability.can(type, section, module))) {
|
||||
NProgress.done();
|
||||
navigation.activeNavigation = to.name.split("-")[1];
|
||||
navigation.activeLink = to.name.split("-")[2];
|
||||
next();
|
||||
} else if (!module && ((admin && ability.isAdmin()) || ability.canSection(type, section))) {
|
||||
NProgress.done();
|
||||
navigation.activeNavigation = to.name.split("-")[1];
|
||||
navigation.activeLink = null;
|
||||
next();
|
||||
} else {
|
||||
NProgress.done();
|
||||
next({ name: "admin-default" });
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue