MDL-7971 check in get_categories if user can see hidden categories uses specific capability not course:create

This commit is contained in:
jmg324 2008-07-16 15:12:09 +00:00
parent ea751786e0
commit 8b09e84569

View File

@ -1255,7 +1255,7 @@ function get_categories($parent='none', $sort=NULL, $shallow=true) {
if( $rs = $DB->get_recordset_sql($sql, $params) ){
foreach($rs as $cat) {
$cat = make_context_subobj($cat);
if ($cat->visible || has_capability('moodle/course:create', $cat->context)) {
if ($cat->visible || has_capability('moodle/category:visibility',$cat->context)) {
$categories[$cat->id] = $cat;
}
}