Skip to content

Commit

Permalink
fix: update route permission judgment
Browse files Browse the repository at this point in the history
  • Loading branch information
b3aton committed Dec 2, 2022
1 parent 770ea01 commit 4053202
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/storefront/src/shared/routes/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,12 @@ const getAllowedRoutes = (globalState: GlobalState): RouteItem[] => {
} = globalState

return routes.filter((item: RouteItem) => {
if (!isB2BUser) {
// b2b user
if (!isB2BUser || (role === 3 && !isAgenting)) {
return item.path !== '/company-orders' && item.path !== '/user-management'
}

if (((role === 3 && !isAgenting) || role === 2) && item.path === '/user-management') return false
if (role === 2 && item.path === '/user-management') return false

if (!storefrontConfig) {
return false
Expand Down

0 comments on commit 4053202

Please sign in to comment.