Hiding custom page in navigation panel

i want to to hide custom page to non admin users, i saw the below code in the documentation but i don't exactly know how it works.
:
public static function shouldRegisterNavigation(): bool
{
return auth()->user()->canManageSettings();
}
Was this page helpful?