Details
Description
At the moment, the "Grades" link is only hidden if the user does not have the capability to view any gradereports in the given context. If a user has the capability to view at least one gradereport, and "Show grades" is set to "No" in the course settings, the "Grades" link still appears in the Admin block (which doesn't check).
At the moment, the user and overview grade reports respect $course->showgrades. Access to a grade report is not provided to a user if $course->showgrades is turned off and the user does not have 'moodle/grade:viewall' capability.
I think the Admin block should use the same logic, so that the appearance of the "Grades" link does not confuse those users.
Done