Site-instellingen: ook Beheerder mag lezen en wijzigen
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -32,12 +32,12 @@ describe('Sidebar role filtering (BR-U3-01 – BR-U3-06)', () => {
|
||||
expect(screen.queryByTestId('nav-profile')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('Administrator sees Dashboard and Users — not Settings or CMS', async () => {
|
||||
it('Administrator sees Dashboard, Users and Settings — not CMS', async () => {
|
||||
mockAuthenticatedAs('Administrator');
|
||||
renderApp('/dashboard');
|
||||
expect(await screen.findByTestId('nav-dashboard')).toBeInTheDocument();
|
||||
expect(screen.getByTestId('nav-users')).toBeInTheDocument();
|
||||
expect(screen.queryByTestId('nav-settings')).not.toBeInTheDocument();
|
||||
expect(screen.getByTestId('nav-settings')).toBeInTheDocument();
|
||||
expect(screen.queryByTestId('nav-cms')).not.toBeInTheDocument();
|
||||
expect(screen.queryByTestId('nav-profile')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
@@ -7,6 +7,7 @@ import { useAuth } from '@/features/auth/context/auth-context';
|
||||
import { useAvailabilityStatus } from '@/features/availability/services/useAvailability';
|
||||
import { useSystemCapabilities } from '@/features/system/services/useSystemCapabilities';
|
||||
import { LanguageSwitcher } from '@/i18n/LanguageSwitcher';
|
||||
import { BrandLogo } from './BrandLogo';
|
||||
import { ThemeToggle } from './ThemeToggle';
|
||||
import { UserMenu } from './UserMenu';
|
||||
|
||||
@@ -38,7 +39,7 @@ const NAV_ITEMS: NavItem[] = [
|
||||
];
|
||||
|
||||
const SETTINGS_ITEM: NavItem = {
|
||||
to: '/settings', labelKey: 'nav.settings', icon: Settings, testId: 'nav-settings', roles: ['Owner'],
|
||||
to: '/settings', labelKey: 'nav.settings', icon: Settings, testId: 'nav-settings', roles: ['Owner', 'Administrator'],
|
||||
};
|
||||
|
||||
interface SidebarProps {
|
||||
@@ -66,10 +67,7 @@ export function Sidebar({ onClose }: SidebarProps = {}) {
|
||||
data-testid="app-sidebar"
|
||||
>
|
||||
<div className="flex h-16 items-center justify-between border-b border-border px-6">
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="h-3 w-3 rounded-full bg-primary" aria-hidden="true" />
|
||||
<span className="text-lg font-semibold">{t('common.appName')}</span>
|
||||
</div>
|
||||
<BrandLogo />
|
||||
{onClose && (
|
||||
<button
|
||||
type="button"
|
||||
|
||||
Reference in New Issue
Block a user