diff --git a/components/InterestDuplicateNotificationBanner.vue b/components/InterestDuplicateNotificationBanner.vue index b9e33d5..2caef43 100644 --- a/components/InterestDuplicateNotificationBanner.vue +++ b/components/InterestDuplicateNotificationBanner.vue @@ -50,15 +50,16 @@ const checkForDuplicates = async () => { try { loading.value = true; - // Check roles with better error handling + // Check roles with better error handling - use hasAnyRole for multiple roles + const { hasAnyRole, isAdmin, isSalesOrAdmin } = useAuthorization(); let canViewDuplicates = false; + try { - canViewDuplicates = await hasRole(['sales', 'admin']); + canViewDuplicates = isSalesOrAdmin(); // Use the convenience method console.log('[InterestDuplicateNotification] Role check result:', canViewDuplicates); } catch (roleError) { console.error('[InterestDuplicateNotification] Role check failed:', roleError); // Try to get user info directly as fallback - const { isAdmin } = useAuthorization(); canViewDuplicates = isAdmin(); console.log('[InterestDuplicateNotification] Fallback admin check:', canViewDuplicates); }