MDL-59172 user: user_can_view_profile() now checks viewalldetails cap

This commit is contained in:
Jake Dallimore 2017-08-01 14:53:33 +08:00
parent 8146b1f06d
commit 4d068a6708
4 changed files with 12 additions and 3 deletions

View file

@ -135,8 +135,7 @@ if (empty($result->posts)) {
// In either case we need to decide whether we can show personal information
// about the requested user to the current user so we will execute some checks
// TODO - Remove extra cap check once MDL-59172 is resolved.
$canviewuser = user_can_view_profile($user, null, $usercontext) || has_capability('moodle/user:viewalldetails', $usercontext);
$canviewuser = user_can_view_profile($user, null, $usercontext);
// Prepare the page title
$pagetitle = get_string('noposts', 'mod_forum');