Skip to content
Browse files

MDL-7971 check in get_categories if user can see hidden categories us…

…es specific capability not course:create
  • Loading branch information...
1 parent ea75178 commit 8b09e84569bf1788958bb7c2574b4aac209a4d89 jmg324 committed Jul 16, 2008
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/datalib.php
View
2 lib/datalib.php
@@ -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;
}
}

0 comments on commit 8b09e84

Please sign in to comment.
Something went wrong with that request. Please try again.