Skip to content

Commit 35c5812

Browse files
Webservice: List issued certificates
There are no checks to see if the user can actually get the list of certificates meaning anyone can get a list of certificates which is a huge security issue.
1 parent 3d3bce9 commit 35c5812

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

classes/external.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ public static function list_issues($timecreatedfrom = null, $userid = null, $cus
276276
];
277277
self::validate_parameters(self::list_issues_parameters(), $params);
278278

279+
$context = \context_system::instance();
280+
require_capability('mod/customcert:viewallcertificates', $context);
281+
279282
$output = [];
280283

281284
list($namefields, $nameparams) = \core_user\fields::get_sql_fullname();

db/services.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
'methodname' => 'list_issues',
5656
'classpath' => '',
5757
'description' => 'List issued certificates',
58+
'capabilities' => 'mod/customcert:viewallcertificates',
5859
'type' => 'read',
5960
'ajax' => true,
6061
],

0 commit comments

Comments
 (0)