MDL-53477 tool_lp: Register coursecompetencymanage as module capability
[moodle.git] / admin / tool / lp / db / access.php
CommitLineData
d9a39950
DW
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 * Capabilities.
19 *
20 * This files lists capabilities related to tool_lp.
21 *
22 * @package tool_lp
23 * @copyright 2015 Damyon Wiese
24 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25 */
26
27defined('MOODLE_INTERNAL') || die();
28
29$capabilities = array(
30
c008e92d 31 // Competencies.
d9a39950
DW
32 'tool/lp:competencymanage' => array(
33 'captype' => 'write',
2de75345 34 'contextlevel' => CONTEXT_COURSECAT,
d9a39950 35 'archetypes' => array(
2de75345
FM
36 'manager' => CAP_ALLOW
37 )
d9a39950 38 ),
44e8cba4 39 'tool/lp:competencyview' => array(
d9a39950 40 'captype' => 'read',
2de75345 41 'contextlevel' => CONTEXT_COURSECAT,
d9a39950
DW
42 'archetypes' => array(
43 'user' => CAP_ALLOW
44 ),
b17d3d10 45 'clonepermissionsfrom' => 'moodle/block:view'
d9a39950 46 ),
c008e92d
FM
47 'tool/lp:competencygrade' => array(
48 'captype' => 'write',
49 'contextlevel' => CONTEXT_COURSE, // And CONTEXT_USER.
50 'archetypes' => array(
51 'editingteacher' => CAP_ALLOW,
fdd85ede 52 'teacher' => CAP_ALLOW,
c008e92d
FM
53 'manager' => CAP_ALLOW
54 ),
55 ),
56 // Course competencies.
b17d3d10 57 'tool/lp:coursecompetencymanage' => array(
d9a39950 58 'captype' => 'write',
b17d3d10 59 'contextlevel' => CONTEXT_COURSE,
d9a39950 60 'archetypes' => array(
b17d3d10
AA
61 'editingteacher' => CAP_ALLOW,
62 'manager' => CAP_ALLOW
d9a39950 63 ),
b17d3d10
AA
64 'clonepermissionsfrom' => 'moodle/site:backup'
65 ),
7ba07487
DW
66 'tool/lp:coursecompetencyconfigure' => array(
67 'captype' => 'write',
3027fe20 68 'contextlevel' => CONTEXT_MODULE,
7ba07487
DW
69 'archetypes' => array(
70 'manager' => CAP_ALLOW
71 ),
72 'clonepermissionsfrom' => 'moodle/site:backup'
73 ),
bf780fbf
DW
74 'tool/lp:coursecompetencygradable' => array(
75 'captype' => 'read',
76 'contextlevel' => CONTEXT_COURSE,
77 'archetypes' => array(
78 'student' => CAP_ALLOW
79 ),
80 'clonepermissionsfrom' => 'moodle/course:isincompletionreports'
81 ),
44e8cba4 82 'tool/lp:coursecompetencyview' => array(
b17d3d10
AA
83 'captype' => 'read',
84 'contextlevel' => CONTEXT_COURSE,
85 'archetypes' => array(
86 'user' => CAP_ALLOW
87 ),
88 'clonepermissionsfrom' => 'moodle/block:view'
d9a39950 89 ),
c008e92d 90 // User plans.
5159d679 91 'tool/lp:planmanage' => array(
4db373d5 92 'captype' => 'write',
53084abb 93 'contextlevel' => CONTEXT_USER,
d9a39950 94 'archetypes' => array(
d9a39950 95 ),
b17d3d10 96 'clonepermissionsfrom' => 'moodle/site:config'
d9a39950 97 ),
5159d679 98 'tool/lp:planmanagedraft' => array(
d9a39950 99 'captype' => 'write',
5159d679 100 'contextlevel' => CONTEXT_USER,
d9a39950
DW
101 'archetypes' => array(
102 ),
b17d3d10 103 'clonepermissionsfrom' => 'moodle/site:config'
d9a39950 104 ),
4db373d5
DM
105 'tool/lp:planmanageown' => array(
106 'captype' => 'write',
107 'contextlevel' => CONTEXT_USER,
108 'archetypes' => array(
109 ),
b17d3d10 110 'clonepermissionsfrom' => 'moodle/site:config'
4db373d5 111 ),
5159d679
FM
112 'tool/lp:planmanageowndraft' => array(
113 'captype' => 'write',
114 'contextlevel' => CONTEXT_USER,
115 'archetypes' => array(
116 ),
117 'clonepermissionsfrom' => 'moodle/site:config'
118 ),
53084abb 119 'tool/lp:planview' => array(
4db373d5
DM
120 'captype' => 'read',
121 'contextlevel' => CONTEXT_USER,
122 'archetypes' => array(
123 ),
b17d3d10 124 'clonepermissionsfrom' => 'moodle/site:config'
4db373d5 125 ),
5159d679
FM
126 'tool/lp:planviewdraft' => array(
127 'captype' => 'read',
128 'contextlevel' => CONTEXT_USER,
129 'archetypes' => array(
130 ),
131 'clonepermissionsfrom' => 'moodle/site:config'
132 ),
4db373d5
DM
133 'tool/lp:planviewown' => array(
134 'captype' => 'read',
135 'contextlevel' => CONTEXT_USER,
136 'archetypes' => array(
137 'user' => CAP_ALLOW
138 ),
b17d3d10 139 'clonepermissionsfrom' => 'moodle/block:view'
4db373d5 140 ),
5159d679
FM
141 'tool/lp:planviewowndraft' => array(
142 'captype' => 'read',
143 'contextlevel' => CONTEXT_USER,
144 'archetypes' => array(
145 ),
146 'clonepermissionsfrom' => 'moodle/site:config'
147 ),
3c230247
FM
148 'tool/lp:planrequestreview' => array(
149 'captype' => 'write',
150 'contextlevel' => CONTEXT_USER,
151 'archetypes' => array(
152 )
153 ),
154 'tool/lp:planrequestreviewown' => array(
155 'captype' => 'write',
156 'contextlevel' => CONTEXT_USER,
157 'archetypes' => array(
158 'user' => CAP_ALLOW
159 )
160 ),
161 'tool/lp:planreview' => array(
162 'captype' => 'write',
163 'contextlevel' => CONTEXT_USER,
164 'archetypes' => array(
165 ),
166 'clonepermissionsfrom' => 'moodle/site:config'
167 ),
168 'tool/lp:plancomment' => array(
169 'captype' => 'write',
170 'contextlevel' => CONTEXT_USER,
171 'archetypes' => array(
172 ),
173 'clonepermissionsfrom' => 'moodle/site:config'
174 ),
175 'tool/lp:plancommentown' => array(
176 'captype' => 'write',
177 'contextlevel' => CONTEXT_USER,
178 'archetypes' => array(
179 'user' => CAP_ALLOW
180 ),
181 ),
943989c2
FM
182 // User competencies.
183 'tool/lp:usercompetencyview' => array(
184 'captype' => 'read',
3b11d638 185 'contextlevel' => CONTEXT_USER, // And CONTEXT_COURSE.
943989c2 186 'archetypes' => array(
1fa13362
IT
187 'editingteacher' => CAP_ALLOW,
188 'teacher' => CAP_ALLOW
943989c2
FM
189 )
190 ),
191 'tool/lp:usercompetencyrequestreview' => array(
192 'captype' => 'write',
3b11d638 193 'contextlevel' => CONTEXT_USER,
943989c2
FM
194 'archetypes' => array(
195 )
196 ),
197 'tool/lp:usercompetencyrequestreviewown' => array(
198 'captype' => 'write',
3b11d638 199 'contextlevel' => CONTEXT_USER,
943989c2
FM
200 'archetypes' => array(
201 'user' => CAP_ALLOW
202 )
203 ),
204 'tool/lp:usercompetencyreview' => array(
205 'captype' => 'write',
3b11d638 206 'contextlevel' => CONTEXT_USER,
943989c2
FM
207 'archetypes' => array(
208 ),
209 'clonepermissionsfrom' => 'moodle/site:config'
210 ),
211 'tool/lp:usercompetencycomment' => array(
212 'captype' => 'write',
3b11d638 213 'contextlevel' => CONTEXT_USER,
943989c2
FM
214 'archetypes' => array(
215 ),
216 'clonepermissionsfrom' => 'moodle/site:config'
217 ),
218 'tool/lp:usercompetencycommentown' => array(
219 'captype' => 'write',
3b11d638 220 'contextlevel' => CONTEXT_USER,
943989c2
FM
221 'archetypes' => array(
222 'user' => CAP_ALLOW
223 ),
224 ),
c008e92d 225 // Template.
b17d3d10
AA
226 'tool/lp:templatemanage' => array(
227 'captype' => 'write',
f0da26a4 228 'contextlevel' => CONTEXT_COURSECAT,
d9a39950 229 'archetypes' => array(
d9a39950 230 ),
b17d3d10 231 'clonepermissionsfrom' => 'moodle/site:config'
d9a39950 232 ),
44e8cba4 233 'tool/lp:templateview' => array(
b17d3d10 234 'captype' => 'read',
f0da26a4 235 'contextlevel' => CONTEXT_COURSECAT,
d9a39950 236 'archetypes' => array(
d9a39950 237 ),
09c81616 238 'clonepermissionsfrom' => 'moodle/site:config'
b17d3d10 239 ),
6c2b163c
FM
240 // User evidence.
241 'tool/lp:userevidencemanage' => array(
242 'captype' => 'write',
243 'contextlevel' => CONTEXT_USER,
244 'archetypes' => array(
245 ),
246 'clonepermissionsfrom' => 'moodle/site:config'
247 ),
248 'tool/lp:userevidencemanageown' => array(
249 'captype' => 'write',
250 'contextlevel' => CONTEXT_USER,
251 'archetypes' => array(
252 'user' => CAP_ALLOW
253 ),
254 'clonepermissionsfrom' => 'moodle/block:view'
255 ),
44e8cba4 256 'tool/lp:userevidenceview' => array(
6c2b163c
FM
257 'captype' => 'read',
258 'contextlevel' => CONTEXT_USER,
259 'archetypes' => array(
260 ),
261 'clonepermissionsfrom' => 'moodle/site:config'
262 ),
d9a39950 263);