MDL-71559 core_user: Fields support for PROFILE_VISIBLE_TEACHERS

This commit is contained in:
sam marshall
2021-06-03 11:23:06 +01:00
parent 30b8ad51f4
commit 007cde2eab
2 changed files with 32 additions and 15 deletions
+4
View File
@@ -380,6 +380,10 @@ class fields {
case PROFILE_VISIBLE_PRIVATE:
$allowed = !$context || has_capability('moodle/user:viewalldetails', $context);
break;
case PROFILE_VISIBLE_TEACHERS:
// This is actually defined (in user/profile/lib.php) based on whether
// you have moodle/site:viewuseridentity in context. We already checked
// that, so treat it as visible (fall through).
case PROFILE_VISIBLE_ALL:
$allowed = true;
break;