Merge remote-tracking branch 'origin/master'

This commit is contained in:
M_Kececi
2026-05-12 11:54:27 +03:00
parent a4f7d5b071
commit f9a035d11d
6 changed files with 122 additions and 181 deletions
+11
View File
@@ -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 ================= */