mirror of
https://github.com/moodle/moodle.git
synced 2025-03-14 04:30:15 +01:00
MDL-53452 tool_lp: Update after conflicts. Use xxxview for cap string
This commit is contained in:
parent
c2f55d2931
commit
14b60a440c
@ -4856,7 +4856,7 @@ class api {
|
||||
/**
|
||||
* Get the competency settings for a course.
|
||||
*
|
||||
* Requires tool/lp:coursecompetencyread capability at the course context.
|
||||
* Requires tool/lp:coursecompetencyview capability at the course context.
|
||||
*
|
||||
* @param int $courseid The course id
|
||||
* @return course_competency_settings
|
||||
@ -4865,9 +4865,9 @@ class api {
|
||||
static::require_enabled();
|
||||
|
||||
// First we do a permissions check.
|
||||
if (!course_competency_settings::can_read($courseid)) {
|
||||
if (!course_competency_settings::can_view($courseid)) {
|
||||
$context = context_course::instance($courseid);
|
||||
throw new required_capability_exception($context, 'tool/lp:coursecompetencyread', 'nopermissions', '');
|
||||
throw new required_capability_exception($context, 'tool/lp:coursecompetencyview', 'nopermissions', '');
|
||||
}
|
||||
|
||||
return course_competency_settings::get_course_settings($courseid);
|
||||
@ -4876,7 +4876,7 @@ class api {
|
||||
/**
|
||||
* Update the competency settings for a course.
|
||||
*
|
||||
* Requires tool/lp:coursecompetencyread capability at the course context.
|
||||
* Requires tool/lp:coursecompetencyconfigure capability at the course context.
|
||||
*
|
||||
* @param int $courseid The course id
|
||||
* @param bool $pushratingstouserplans Push competency ratings to user plans immediately.
|
||||
|
@ -79,15 +79,15 @@ class course_competency_settings extends persistent {
|
||||
}
|
||||
|
||||
/**
|
||||
* Can the current user change competency settings for this course.
|
||||
* Can the current user view competency settings for this course.
|
||||
*
|
||||
* @param int $data The course ID.
|
||||
* @return bool
|
||||
*/
|
||||
public static function can_read($courseid) {
|
||||
public static function can_view($courseid) {
|
||||
$context = context_course::instance($courseid);
|
||||
|
||||
$capabilities = array('tool/lp:coursecompetencyread');
|
||||
$capabilities = array('tool/lp:coursecompetencyview');
|
||||
|
||||
return has_any_capability($capabilities, $context);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user