]> git.mjollnir.org Git - moodle.git/commitdiff
merged fix for MDL-7119, users with no capability should not see roles tab
authortoyomoyo <toyomoyo>
Fri, 20 Oct 2006 08:09:53 +0000 (08:09 +0000)
committertoyomoyo <toyomoyo>
Fri, 20 Oct 2006 08:09:53 +0000 (08:09 +0000)
user/tabs.php

index ca57b309d22f692f8657f0254e0456e911d23c9a..b2c531bee832a12965040a8c81956383dd6d5f15 100644 (file)
 
     /// this needs permission checkings
 
-    if (!empty($showroles)) { // this variable controls whether this roles is showed, or not, so only user/view page should set this flag
+    if (!empty($showroles) && has_capability('moodle/role:assign',$usercontext)) { // this variable controls whether this roles is showed, or not, so only user/view page should set this flag
         $usercontext = get_context_instance(CONTEXT_USER, $user->id);
         $toprow[] = new tabobject('roles', $CFG->wwwroot.'/'.$CFG->admin.'/roles/assign.php?contextid='.$usercontext->id.'&amp;userid='.$user->id.'&amp;courseid='.$course->id
                               ,get_string('roles'));