MDL-71559 core_user: Fields support for PROFILE_VISIBLE_TEACHERS

This commit is contained in:
sam marshall
2021-06-03 11:24:24 +01:00
parent 2d82188d89
commit 52636524d4
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;