mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
MDL-7971 check in get_categories if user can see hidden categories uses specific capability not course:create
This commit is contained in:
parent
ea751786e0
commit
8b09e84569
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user