Thank you very much for the solutions provided. These solutions are based on the configuration of authentication methods (LDAP, CAS ...), and may or may not block the fields we want is a generic solution, since it applies to all system roles. The ideal and what I am looking for is that only users with a student role can not edit their profile (name and surname) but any other user with another role, for example, teacher role or course creator, can modify name and last names of the students.
Anyway, thank you very much for the instructions.
General developer forum
Restrict profile editing to user with student role!