Skip to content

Commit

Permalink
MDL-34228 Completion: Add capability that controls if a user is shown…
Browse files Browse the repository at this point in the history
… in reports
  • Loading branch information
sammarshallou committed Oct 4, 2012
1 parent 5d6285c commit b61924d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions lang/en/role.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
$string['course:enrolconfig'] = 'Configure enrol instances in courses';
$string['course:enrolreview'] = 'Review course enrolments';
$string['course:ignorefilesizelimits'] = 'Use files larger than any file size restrictions';
$string['course:isincompletionreports'] = 'Be shown on completion reports';
$string['course:manageactivities'] = 'Manage activities';
$string['course:managefiles'] = 'Manage files';
$string['course:managegrades'] = 'Manage grades';
Expand Down
3 changes: 2 additions & 1 deletion lib/completionlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,8 @@ public function get_tracked_users($where = '', $whereparams = array(), $groupid
global $DB;

list($enrolledsql, $params) = get_enrolled_sql(
context_course::instance($this->course->id), '', $groupid, true);
context_course::instance($this->course->id),
'moodle/course:isincompletionreports', $groupid, true);

$sql = 'SELECT u.id, u.firstname, u.lastname, u.idnumber';
if ($extracontext) {
Expand Down
8 changes: 8 additions & 0 deletions lib/db/access.php
Original file line number Diff line number Diff line change
Expand Up @@ -979,6 +979,14 @@
)
),

'moodle/course:isincompletionreports' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'student' => CAP_ALLOW,
),
),

'moodle/course:viewscales' => array(

'captype' => 'read',
Expand Down

0 comments on commit b61924d

Please sign in to comment.