Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.1, 3.4, 3.6.2
-
Component/s: Competencies
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_31_STABLE, MOODLE_34_STABLE, MOODLE_36_STABLE
-
Fixed Branches:MOODLE_35_STABLE, MOODLE_36_STABLE
-
Pull from Repository:
-
Pull 3.5 Branch:
MDL-55135-35-competencies-manage-in-coursecontext -
Pull Master Branch:
MDL-55135-master-competencies-manage-in-coursecontext
Description
If a user is given capability to view course competencies (moodle/competency:coursecompetencyview) but does not have capability to view competency frameworks (moodle/competency:competencyview), page /admin/tool/lp/coursecompetencies.php throws an exception:
Sorry, but you do not currently have permissions to do that (View competency frameworks)
|
More information about this error
|
|
×Debug info:
|
Error code: nopermissions
|
×Stack trace:
|
line 4987 of /competency/classes/api.php: required_capability_exception thrown
|
line 58 of /admin/tool/lp/classes/course_competency_statistics.php: call to core_competency\api::get_least_proficient_competencies_for_course()
|
line 85 of /admin/tool/lp/classes/output/course_competencies_page.php: call to tool_lp\course_competency_statistics->__construct()
|
line 43 of /admin/tool/lp/coursecompetencies.php: call to tool_lp\output\course_competencies_page->__construct()
|
According to Fred, the capabilities check is not correct in core_competency\api::get_least_proficient_competencies_for_course() and it should be checking for coursecompetencyview and not competencyview
Another thing I noticed during work on MDL-55032:
if course has guest access and guests are given capability to view course competencies, the non-working link is displayed to the guest on this page
Attachments
Issue Links
- Discovered while testing
-
MDL-55032 Confusing competencies link in Course administration when using guest access
-
- Closed
-