MDL-53452 tool_lp: Update after conflicts. Use xxxview for cap string

This commit is contained in:
Damyon Wiese 2016-03-29 15:37:40 +08:00 committed by Frederic Massart
parent c2f55d2931
commit 14b60a440c
2 changed files with 7 additions and 7 deletions

View File

@ -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.

View File

@ -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);
}