Skip to content

Commit

Permalink
MDL-39865 navigation: Removed unaccessible repositories node
Browse files Browse the repository at this point in the history
A user is not allowed to edit another user's repositories, in any
circumstances. The repositories node under 'Profile setting for X'
does not make sense under those conditions.
  • Loading branch information
Frederic Massart committed Jun 4, 2013
1 parent 3e17b1c commit 16725a7
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions lib/navigationlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -4031,23 +4031,6 @@ protected function generate_user_settings($courseid, $userid, $gstitle='usercurr
$usersetting->add(get_string('securitykeys', 'webservice'), $url, self::TYPE_SETTING);
}

// Repository
if (!$currentuser && $usercontext->contextlevel == CONTEXT_USER) {
if (!$this->cache->cached('contexthasrepos'.$usercontext->id)) {
require_once($CFG->dirroot . '/repository/lib.php');
$editabletypes = repository::get_editable_types($usercontext);
$haseditabletypes = !empty($editabletypes);
unset($editabletypes);
$this->cache->set('contexthasrepos'.$usercontext->id, $haseditabletypes);
} else {
$haseditabletypes = $this->cache->{'contexthasrepos'.$usercontext->id};
}
if ($haseditabletypes) {
$url = new moodle_url('/repository/manage_instances.php', array('contextid'=>$usercontext->id));
$usersetting->add(get_string('repositories', 'repository'), $url, self::TYPE_SETTING);
}
}

// Messaging
if (($currentuser && has_capability('moodle/user:editownmessageprofile', $systemcontext)) || (!isguestuser($user) && has_capability('moodle/user:editmessageprofile', $usercontext) && !is_primary_admin($user->id))) {
$url = new moodle_url('/message/edit.php', array('id'=>$user->id));
Expand Down

0 comments on commit 16725a7

Please sign in to comment.