-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaccess.php
53 lines (48 loc) · 1.57 KB
/
access.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
// This file is part of the qrexamlock plugin for Moodle - http://moodle.org/
//
// qrexamlock is a plugin to enhance exam security using QR code-based access control.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
defined('MOODLE_INTERNAL') || die();
$capabilities = [
// Capability for managing the plugin settings.
'local/qrexamlock:manage' => [
'riskbitmask' => RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => [
'manager' => CAP_ALLOW,
],
],
// Capability for viewing QR codes for exams.
'local/qrexamlock:viewqrcode' => [
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'teacher' => CAP_ALLOW,
'student' => CAP_ALLOW,
],
],
// Capability for scanning and validating QR codes.
'local/qrexamlock:validateqrcode' => [
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
'teacher' => CAP_ALLOW,
],
],
// Capability for generating reports about QR code scans.
'local/qrexamlock:generatereports' => [
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'manager' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
],
],
];