It's a bit tricky as there are conditions around students on the same courses can see more than those that don't - I don't think I've ever 100% understood it.
However, there's quite a few relevant settings in here - User_policies
You may want to consider enabling this Capability for the relevant roles as well - https://docs.moodle.org/34/en/Capabilities/moodle/site:viewuseridentity