Skip to content

Commit

Permalink
MDL-15632 Wrong permission in the admin tree defininition mean that p…
Browse files Browse the repository at this point in the history
…eople with moodle/role:manage could not define role, and people with moodle/role:assign could not assign system roles.
  • Loading branch information
tjhunt committed Sep 12, 2008
1 parent 167fd7f commit 61d04bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions admin/settings/users.php
Expand Up @@ -6,7 +6,9 @@
or has_capability('moodle/site:uploadusers', $systemcontext)
or has_capability('moodle/user:create', $systemcontext)
or has_capability('moodle/user:update', $systemcontext)
or has_capability('moodle/user:delete', $systemcontext)) { // speedup for non-admins, add all caps used on this page
or has_capability('moodle/user:delete', $systemcontext)
or has_capability('moodle/role:manage', $systemcontext)
or has_capability('moodle/role:assign', $systemcontext)) { // speedup for non-admins, add all caps used on this page


$ADMIN->add('users', new admin_category('authsettings', get_string('authentication','admin')));
Expand Down Expand Up @@ -78,8 +80,8 @@

// stuff under the "roles" subcategory
$ADMIN->add('users', new admin_category('roles', get_string('permissions', 'role')));
$ADMIN->add('roles', new admin_externalpage('defineroles', get_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php"));
$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignglobalroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=".$systemcontext->id));
$ADMIN->add('roles', new admin_externalpage('defineroles', get_string('defineroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/manage.php", 'moodle/role:manage'));
$ADMIN->add('roles', new admin_externalpage('assignroles', get_string('assignglobalroles', 'role'), "$CFG->wwwroot/$CFG->admin/roles/assign.php?contextid=".$systemcontext->id, 'moodle/role:assign'));


// "userpolicies" settingpage
Expand Down

0 comments on commit 61d04bc

Please sign in to comment.