When doing menu search, some menus that the user didn't have permission to use were presented to him. Fix #850.