fix: custom menu security hardening and code quality improvements
- Add admin menu permission check in CustomPageView (visibility + role) - Sanitize SVG content with DOMPurify before v-html rendering (XSS prevention) - Decouple router.go from dto package using anonymous struct - Consolidate duplicate parseCustomMenuItems into dto.ParseCustomMenuItems - Enhance menu item validation (count, length, ID uniqueness limits) - Add audit logging for purchase_subscription and custom_menu_items changes - Update API contract test to include custom_menu_items field Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -87,7 +87,11 @@ const menuItemId = computed(() => route.params.id as string)
|
||||
|
||||
const menuItem = computed(() => {
|
||||
const items = appStore.cachedPublicSettings?.custom_menu_items ?? []
|
||||
return items.find((item) => item.id === menuItemId.value) ?? null
|
||||
const found = items.find((item) => item.id === menuItemId.value) ?? null
|
||||
if (found && found.visibility === 'admin' && !authStore.isAdmin) {
|
||||
return null
|
||||
}
|
||||
return found
|
||||
})
|
||||
|
||||
const embeddedUrl = computed(() => {
|
||||
|
||||
Reference in New Issue
Block a user