BUG with moodle/user:viewhiddendetails???

BUG with moodle/user:viewhiddendetails???

by Gisela Hillenbrand -
Number of replies: 0
Picture of Documentation writers
Hi all,

I have problems understanding the capability moodle/user:viewhiddendetails.

For data protection reasons I dont want to display these information - not to teachers and not to students within a course. So I set this capability to "not set" for the teacher and student roles. Now the result:
Looking at the participants list as a teacher (block "People", link "participants") I still see the hidden details (e.g. last access) in the list. Clicking on an individual user, the information in the users profile is hidden. As a student I do not see the information (neither in the list nor in an individual profile) - i.e. for students it works as expected.

So looking at the code in user/index.php (this script generates the participants list) I find the following code:

/// Get the hidden field list
if (has_capability('moodle/course:viewhiddenuserfields', $context)) {
$hiddenfields = array(); // teachers and admins are allowed to see everything
} else {
$hiddenfields = array_flip(explode(',', $CFG->hiddenuserfields));
}

In my opinion this is not a good programming if settings which can be configured then in the code implementation are ignored. Or is there a reason why teachers and admins should see the hidden user fields even if the roles settings prohibit this?

Looking forward to an explanation!

Gisela


Average of ratings: -