5d1829cf28ed92fbba4235de31adcc71b7674ff8
[moodle.git] / admin / tool / lp / db / access.php
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/>.
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  */
27 defined('MOODLE_INTERNAL') || die();
29 $capabilities = array(
31     // Competencies.
32     'tool/lp:competencymanage' => array(
33         'captype' => 'write',
34         'contextlevel' => CONTEXT_COURSECAT,
35         'archetypes' => array(
36             'manager' => CAP_ALLOW
37         )
38     ),
39     'tool/lp:competencyview' => array(
40         'captype' => 'read',
41         'contextlevel' => CONTEXT_COURSECAT,
42         'archetypes' => array(
43             'user' => CAP_ALLOW
44         ),
45         'clonepermissionsfrom' => 'moodle/block:view'
46     ),
47     'tool/lp:competencygrade' => array(
48         'captype' => 'write',
49         'contextlevel' => CONTEXT_COURSE, // And CONTEXT_USER.
50         'archetypes' => array(
51             'editingteacher' => CAP_ALLOW,
52             'teacher' => CAP_ALLOW,
53             'manager' => CAP_ALLOW
54         ),
55     ),
56     // Course competencies.
57     'tool/lp:coursecompetencymanage' => array(
58         'captype' => 'write',
59         'contextlevel' => CONTEXT_COURSE,
60         'archetypes' => array(
61             'editingteacher' => CAP_ALLOW,
62             'manager' => CAP_ALLOW
63         ),
64         'clonepermissionsfrom' => 'moodle/site:backup'
65     ),
66     'tool/lp:coursecompetencyconfigure' => array(
67         'captype' => 'write',
68         'contextlevel' => CONTEXT_COURSE,
69         'archetypes' => array(
70             'manager' => CAP_ALLOW
71         ),
72         'clonepermissionsfrom' => 'moodle/site:backup'
73     ),
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     ),
82     'tool/lp:coursecompetencyview' => array(
83         'captype' => 'read',
84         'contextlevel' => CONTEXT_COURSE,
85         'archetypes' => array(
86             'user' => CAP_ALLOW
87         ),
88         'clonepermissionsfrom' => 'moodle/block:view'
89     ),
90     // User plans.
91     'tool/lp:planmanage' => array(
92         'captype' => 'write',
93         'contextlevel' => CONTEXT_USER,
94         'archetypes' => array(
95         ),
96         'clonepermissionsfrom' => 'moodle/site:config'
97     ),
98     'tool/lp:planmanagedraft' => array(
99         'captype' => 'write',
100         'contextlevel' => CONTEXT_USER,
101         'archetypes' => array(
102         ),
103         'clonepermissionsfrom' => 'moodle/site:config'
104     ),
105     'tool/lp:planmanageown' => array(
106         'captype' => 'write',
107         'contextlevel' => CONTEXT_USER,
108         'archetypes' => array(
109         ),
110         'clonepermissionsfrom' => 'moodle/site:config'
111     ),
112     'tool/lp:planmanageowndraft' => array(
113         'captype' => 'write',
114         'contextlevel' => CONTEXT_USER,
115         'archetypes' => array(
116         ),
117         'clonepermissionsfrom' => 'moodle/site:config'
118     ),
119     'tool/lp:planview' => array(
120         'captype' => 'read',
121         'contextlevel' => CONTEXT_USER,
122         'archetypes' => array(
123         ),
124         'clonepermissionsfrom' => 'moodle/site:config'
125     ),
126     'tool/lp:planviewdraft' => array(
127         'captype' => 'read',
128         'contextlevel' => CONTEXT_USER,
129         'archetypes' => array(
130         ),
131         'clonepermissionsfrom' => 'moodle/site:config'
132     ),
133     'tool/lp:planviewown' => array(
134         'captype' => 'read',
135         'contextlevel' => CONTEXT_USER,
136         'archetypes' => array(
137             'user' => CAP_ALLOW
138         ),
139         'clonepermissionsfrom' => 'moodle/block:view'
140     ),
141     'tool/lp:planviewowndraft' => array(
142         'captype' => 'read',
143         'contextlevel' => CONTEXT_USER,
144         'archetypes' => array(
145         ),
146         'clonepermissionsfrom' => 'moodle/site:config'
147     ),
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     ),
182     // User competencies.
183     'tool/lp:usercompetencyview' => array(
184         'captype' => 'read',
185         'contextlevel' => CONTEXT_USER,     // And CONTEXT_COURSE.
186         'archetypes' => array(
187             'editingteacher' => CAP_ALLOW,
188             'teacher' => CAP_ALLOW
189         )
190     ),
191     'tool/lp:usercompetencyrequestreview' => array(
192         'captype' => 'write',
193         'contextlevel' => CONTEXT_USER,
194         'archetypes' => array(
195         )
196     ),
197     'tool/lp:usercompetencyrequestreviewown' => array(
198         'captype' => 'write',
199         'contextlevel' => CONTEXT_USER,
200         'archetypes' => array(
201             'user' => CAP_ALLOW
202         )
203     ),
204     'tool/lp:usercompetencyreview' => array(
205         'captype' => 'write',
206         'contextlevel' => CONTEXT_USER,
207         'archetypes' => array(
208         ),
209         'clonepermissionsfrom' => 'moodle/site:config'
210     ),
211     'tool/lp:usercompetencycomment' => array(
212         'captype' => 'write',
213         'contextlevel' => CONTEXT_USER,
214         'archetypes' => array(
215         ),
216         'clonepermissionsfrom' => 'moodle/site:config'
217     ),
218     'tool/lp:usercompetencycommentown' => array(
219         'captype' => 'write',
220         'contextlevel' => CONTEXT_USER,
221         'archetypes' => array(
222             'user' => CAP_ALLOW
223         ),
224     ),
225     // Template.
226     'tool/lp:templatemanage' => array(
227         'captype' => 'write',
228         'contextlevel' => CONTEXT_COURSECAT,
229         'archetypes' => array(
230         ),
231         'clonepermissionsfrom' => 'moodle/site:config'
232     ),
233     'tool/lp:templateview' => array(
234         'captype' => 'read',
235         'contextlevel' => CONTEXT_COURSECAT,
236         'archetypes' => array(
237         ),
238         'clonepermissionsfrom' => 'moodle/site:config'
239     ),
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     ),
256     'tool/lp:userevidenceview' => array(
257         'captype' => 'read',
258         'contextlevel' => CONTEXT_USER,
259         'archetypes' => array(
260         ),
261         'clonepermissionsfrom' => 'moodle/site:config'
262     ),
263 );