src/Webpage/DefaultMenuAuthenticator.php
private function authenticateMenuEntries(Menu $menu, array $userRoles) {
	
		foreach($menu->getEntries() as $e) {
	
			if(!$e->getAuth()) {
				$e->setAttribute('display', NULL);
			}
	
			else {
				$e->setAttribute('display', 'none');
	
				foreach($userRoles as $role) {
						
					if($e->isAuthenticatedByRole($role)) {
						$e->setAttribute('display', NULL);
						break;
					}

				}
			}
	
		}
	
	}
private function authenticateMenuEntries(Menu $menu, array $userRoles) {
	
		foreach($menu->getEntries() as $e) {
	
			if(!$e->getAuth()) {
				$e->setAttribute('display', NULL);
			}
	
			else {
				$e->setAttribute('display', 'none');
	
				foreach($userRoles as $role) {
						
					if($e->isAuthenticatedByRole($role)) {
						$e->setAttribute('display', NULL);
						break;
					}

				}
			}
	
		}
	
	}
private function authenticateMenuEntries ( Menu $ menu , array $ userRoles ) { foreach ( $ menu -> getEntries ( ) as $ e ) { if ( ! $ e -> getAuth ( ) ) { $ e -> setAttribute ( 'display' , NULL ) ; } else { $ e -> setAttribute ( 'display' , 'none' ) ; foreach ( $ userRoles as $ role ) { if ( $ e -> isAuthenticatedByRole ( $ role ) ) { $ e -> setAttribute ( 'display' , NULL ) ; break ; } } } } }
authenticate menu entries by checking each one against the
user's roles if necessary

@param Menu $menu
@param Role[] $userRoles
authenticate menu entries by checking each one against the user s roles if necessary