Skip to content

Commit

Permalink
MDL-53452 tool_lp: Update after conflicts. Use xxxview for cap string
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese authored and Frederic Massart committed Apr 18, 2016
1 parent c2f55d2 commit 14b60a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions admin/tool/lp/classes/api.php
Expand Up @@ -4856,7 +4856,7 @@ public static function template_viewed($templateorid) {
/**
* 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
Expand All @@ -4865,9 +4865,9 @@ public static function read_course_competency_settings($courseid) {
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);
Expand All @@ -4876,7 +4876,7 @@ public static function read_course_competency_settings($courseid) {
/**
* 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.
Expand Down
6 changes: 3 additions & 3 deletions admin/tool/lp/classes/course_competency_settings.php
Expand Up @@ -79,15 +79,15 @@ public static function get_course_settings($courseid) {
}

/**
* 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);
}
Expand Down

0 comments on commit 14b60a4

Please sign in to comment.