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

Standarise mod/$modname:view capability checkings across activities

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.2
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None
    • Affected Branches:
      MOODLE_32_STABLE

      Description

      In MDL-49029 mod/choice:view capability was added and it required nothing else than the capability without any extra has_capability checking, as modinfo is checking mod/$modname:view capability permissions for us. This includes:

      • require_login & require_course_login with $cm
      • validate_context (external functions)
      • get_all_instances_in_course instances
      • global search

      We should be consistent across activities and perform the same kind of checkings. Right now some modules have a require_capability in mod/name/view.php some of them don't, mod/name/index.php should include a big require_capability on top of all other checkings?

      I see this mod/$modname:view capability as the whole activity is not available for users without this capability. This issue will also help us check that we are not missing any point of entry when the capability is disabled.

      Creating an issue for it as suggested by Eloy.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                2 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated: