Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 efrain 1
<?php
2
// This file is part of Moodle - http://moodle.org/
3
//
4
// Moodle is free software: you can redistribute it and/or modify
5
// it under the terms of the GNU General Public License as published by
6
// the Free Software Foundation, either version 3 of the License, or
7
// (at your option) any later version.
8
//
9
// Moodle is distributed in the hope that it will be useful,
10
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
// GNU General Public License for more details.
13
//
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
16
 
17
/**
18
 * Capability definitions for the hvp module.
19
 *
20
 * Available archetypes:
21
 *  manager
22
 *  coursecreator
23
 *  editingteacher
24
 *  teacher
25
 *  student
26
 *  guest
27
 *  user
28
 *  frontpage
29
 *
30
 * @package    mod_hvp
31
 * @copyright  2016 Joubel AS <contact@joubel.com>
32
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
33
 */
34
 
35
defined('MOODLE_INTERNAL') || die();
36
 
37
$capabilities = array(
38
 
39
    'mod/hvp:view' => array(
40
        'captype' => 'read',
41
        'contextlevel' => CONTEXT_MODULE,
42
        'archetypes' => array(
43
            'manager' => CAP_ALLOW,
44
            'editingteacher' => CAP_ALLOW,
45
            'teacher' => CAP_ALLOW,
46
            'student' => CAP_ALLOW,
47
            'guest' => CAP_ALLOW
48
        )
49
    ),
50
 
51
    'mod/hvp:addinstance' => array(
52
        'riskbitmask' => RISK_SPAM | RISK_XSS,
53
        'captype' => 'write',
54
        'contextlevel' => CONTEXT_COURSE,
55
        'archetypes' => array(
56
            'editingteacher' => CAP_ALLOW,
57
            'manager' => CAP_ALLOW
58
        ),
59
        'clonepermissionsfrom' => 'moodle/course:manageactivities'
60
    ),
61
 
62
    'mod/hvp:manage' => array(
63
        'riskbitmask' => RISK_SPAM | RISK_XSS,
64
        'captype' => 'write',
65
        'contextlevel' => CONTEXT_MODULE,
66
        'archetypes' => array(
67
            'editingteacher' => CAP_ALLOW,
68
            'manager' => CAP_ALLOW
69
        ),
70
        'clonepermissionsfrom' => 'mod/hvp:addinstance'
71
    ),
72
 
73
    'mod/hvp:share' => array(
74
        'riskbitmask' => RISK_SPAM,
75
        'captype' => 'write',
76
        'contextlevel' => CONTEXT_MODULE,
77
        'archetypes' => array(
78
            'editingteacher' => CAP_ALLOW,
79
            'manager' => CAP_ALLOW
80
        ),
81
        'clonepermissionsfrom' => 'mod/hvp:addinstance'
82
    ),
83
 
84
    'mod/hvp:getexport' => array(
85
        'captype' => 'read',
86
        'contextlevel' => CONTEXT_MODULE,
87
        'archetypes' => array(
88
            'manager' => CAP_ALLOW,
89
            'editingteacher' => CAP_ALLOW,
90
            'teacher' => CAP_ALLOW
91
        )
92
    ),
93
 
94
    'mod/hvp:getembedcode' => array(
95
        'captype' => 'read',
96
        'contextlevel' => CONTEXT_MODULE,
97
        'archetypes' => array(
98
            'manager' => CAP_ALLOW,
99
            'editingteacher' => CAP_ALLOW,
100
            'teacher' => CAP_ALLOW
101
        )
102
    ),
103
 
104
    'mod/hvp:saveresults' => array(
105
        'riskbitmask' => RISK_SPAM,
106
        'captype' => 'write',
107
        'contextlevel' => CONTEXT_MODULE,
108
        'archetypes' => array(
109
            'student' => CAP_ALLOW
110
        )
111
    ),
112
 
113
    'mod/hvp:savecontentuserdata' => array(
114
        'captype' => 'write',
115
        'contextlevel' => CONTEXT_MODULE,
116
        'archetypes' => array(
117
            'manager' => CAP_ALLOW,
118
            'editingteacher' => CAP_ALLOW,
119
            'teacher' => CAP_ALLOW,
120
            'student' => CAP_ALLOW
121
        )
122
    ),
123
 
124
    'mod/hvp:viewresults' => array(
125
        'captype' => 'write',
126
        'contextlevel' => CONTEXT_MODULE,
127
        'archetypes' => array(
128
            'student' => CAP_ALLOW
129
        )
130
    ),
131
 
132
    'mod/hvp:viewallresults' => array(
133
        'captype' => 'read',
134
        'contextlevel' => CONTEXT_MODULE,
135
        'archetypes' => array(
136
            'manager' => CAP_ALLOW,
137
            'editingteacher' => CAP_ALLOW,
138
            'teacher' => CAP_ALLOW
139
        )
140
    ),
141
 
142
    'mod/hvp:restrictlibraries' => array(
143
        'captype' => 'write',
144
        'contextlevel' => CONTEXT_SYSTEM,
145
        'archetypes' => array(
146
          'manager' => CAP_ALLOW
147
        )
148
    ),
149
 
150
    'mod/hvp:userestrictedlibraries' => array(
151
        'captype' => 'write',
152
        'contextlevel' => CONTEXT_COURSE,
153
        'archetypes' => array(
154
            'manager' => CAP_ALLOW
155
        )
156
    ),
157
 
158
    'mod/hvp:updatelibraries' => array(
159
        'captype' => 'write',
160
        'contextlevel' => CONTEXT_SYSTEM,
161
        'archetypes' => array(
162
            'manager' => CAP_ALLOW
163
        )
164
    ),
165
 
166
    'mod/hvp:getcachedassets' => array(
167
        'captype' => 'read',
168
        'contextlevel' => CONTEXT_SYSTEM,
169
        'archetypes' => array(
170
            'manager' => CAP_ALLOW,
171
            'editingteacher' => CAP_ALLOW,
172
            'teacher' => CAP_ALLOW,
173
            'student' => CAP_ALLOW,
174
            'user' => CAP_ALLOW,
175
            'guest' => CAP_ALLOW
176
        )
177
    ),
178
 
179
    'mod/hvp:installrecommendedh5plibraries' => array(
180
        'captype' => 'write',
181
        'contextlevel' => CONTEXT_COURSE,
182
        'archetypes' => array(
183
          'manager' => CAP_ALLOW
184
        )
185
    ),
186
 
187
    // Receive a confirmation message of own h5p submission.
188
    'mod/hvp:emailconfirmsubmission' => array(
189
        'captype' => 'read',
190
        'contextlevel' => CONTEXT_MODULE,
191
        'archetypes' => array()
192
    ),
193
 
194
    // Receive a notification message of other peoples' h5p submissions.
195
    'mod/hvp:emailnotifysubmission' => array(
196
        'captype' => 'read',
197
        'contextlevel' => CONTEXT_MODULE,
198
        'archetypes' => array()
199
    ),
200
 
201
    'mod/hvp:contenthubregistration' => [
202
        'captype' => 'write',
203
        'contextlevel' => CONTEXT_SYSTEM,
204
        'archetypes' => [], // Only admins by default.
205
    ],
206
 
207
);