Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-61636

\coursecat::get_all $options.returnhidden param allows not user visible categories to be returned

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Inactive
    • Icon: Minor Minor
    • None
    • 3.5
    • Course
    • None
    • MOODLE_35_STABLE

      For what I understand \coursecat::get_all is supposed to check that the user has permissions to see the categories. If 'returnhidden' option is provided permissions are not checked.

      It seems to me that

      if (!empty($options['returnhidden']) || $category->is_uservisible()) {
      

      should be converted to

      if ($category->is_uservisible() && ($options['returnhidden'] || $category->visible)) {
      

      Maybe it is just that I am not interpreting well how the function works or maybe we just need to update 'returnhidden' param docs, but the current returnhidden status is not clear and I can't see any usage of it in core that helps me confirm if it makes sense or not.

            Unassigned Unassigned
            dmonllao David Monllaó
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.