mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
9e1fe42150
Prior to the fix, if you did not have a capability like mod/page:view, then you woulds still see the link to the Page activity in the course section, but when you clicked on it, you would run into a require_capability error. It is a principle that we never show users a link to a page they are not allowed to access, therefore, when users do not have mod/...:view, they should not see the link on the course page. This patch implements this in the cm_info class, in a similar way to how access restrictions by groups works. It does not assume that the mod/...:view capability exists. If the capability does not exist, then users are not prevented from seeing the link.