Browse Source

chore(nc-gui): formatting

pull/3801/head
braks 2 years ago
parent
commit
b5b42c7034
  1. 2
      packages/nc-gui/middleware/auth.global.ts

2
packages/nc-gui/middleware/auth.global.ts

@ -75,8 +75,10 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
/** if users are accessing the projects without having enough permissions, redirect to My Projects page */
if (to.params.projectId && from.params.projectId !== to.params.projectId) {
const user = await api.auth.me({ project_id: to?.params?.projectId as string })
if (user?.roles?.user) {
message.error("You don't have enough permission to access the project.")
return navigateTo('/')
}
}

Loading…
Cancel
Save