Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -5,6 +5,7 @@ import routes from 'src/router/routes.js'
|
||||
|
||||
import { useAuthStore } from 'stores/authStore'
|
||||
import { usePermissionStore } from 'stores/permissionStore'
|
||||
import { getAuthUserId } from 'src/modules/activityLogs'
|
||||
|
||||
|
||||
export default route(function () {
|
||||
@@ -54,6 +55,16 @@ export default route(function () {
|
||||
return next('/first-password-change')
|
||||
}
|
||||
|
||||
/* ================= USER ID RESTRICTIONS ================= */
|
||||
|
||||
const onlyUserIds = to.meta?.onlyUserIds
|
||||
if (Array.isArray(onlyUserIds) && onlyUserIds.length > 0) {
|
||||
const id = getAuthUserId(auth.user)
|
||||
if (id == null || !onlyUserIds.includes(id)) {
|
||||
return next('/unauthorized')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ================= ADMIN ================= */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user