Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.10.x will end 8 November 2021 (12 months).
  • Bug fixes for security issues in 3.10.x will end 9 May 2022 (18 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
   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   * Plugin capabilities
  19   *
  20   * @package    mod_glossary
  21   * @copyright  2006 Martin Dougiamas
  22   * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  23   */
  24  
  25  defined('MOODLE_INTERNAL') || die();
  26  
  27  $capabilities = array(
  28  
  29      'mod/glossary:addinstance' => array(
  30          'riskbitmask' => RISK_XSS,
  31  
  32          'captype' => 'write',
  33          'contextlevel' => CONTEXT_COURSE,
  34          'archetypes' => array(
  35              'editingteacher' => CAP_ALLOW,
  36              'manager' => CAP_ALLOW
  37          ),
  38          'clonepermissionsfrom' => 'moodle/course:manageactivities'
  39      ),
  40  
  41      'mod/glossary:view' => array(
  42  
  43          'captype' => 'read',
  44          'contextlevel' => CONTEXT_MODULE,
  45          'archetypes' => array(
  46              'frontpage' => CAP_ALLOW,
  47              'guest' => CAP_ALLOW,
  48              'student' => CAP_ALLOW,
  49              'teacher' => CAP_ALLOW,
  50              'editingteacher' => CAP_ALLOW,
  51              'manager' => CAP_ALLOW
  52          )
  53      ),
  54  
  55      'mod/glossary:write' => array(
  56  
  57          'riskbitmask' => RISK_SPAM,
  58  
  59          'captype' => 'write',
  60          'contextlevel' => CONTEXT_MODULE,
  61          'archetypes' => array(
  62              'student' => CAP_ALLOW,
  63              'teacher' => CAP_ALLOW,
  64              'editingteacher' => CAP_ALLOW,
  65              'manager' => CAP_ALLOW
  66          )
  67      ),
  68  
  69      'mod/glossary:manageentries' => array(
  70  
  71          'riskbitmask' => RISK_SPAM,
  72  
  73          'captype' => 'write',
  74          'contextlevel' => CONTEXT_MODULE,
  75          'archetypes' => array(
  76              'teacher' => CAP_ALLOW,
  77              'editingteacher' => CAP_ALLOW,
  78              'manager' => CAP_ALLOW
  79          )
  80      ),
  81  
  82      'mod/glossary:managecategories' => array(
  83  
  84          'riskbitmask' => RISK_SPAM,
  85  
  86          'captype' => 'write',
  87          'contextlevel' => CONTEXT_MODULE,
  88          'archetypes' => array(
  89              'teacher' => CAP_ALLOW,
  90              'editingteacher' => CAP_ALLOW,
  91              'manager' => CAP_ALLOW
  92          )
  93      ),
  94  
  95      'mod/glossary:comment' => array(
  96  
  97          'riskbitmask' => RISK_SPAM,
  98  
  99          'captype' => 'write',
 100          'contextlevel' => CONTEXT_MODULE,
 101          'archetypes' => array(
 102              'student' => CAP_ALLOW,
 103              'teacher' => CAP_ALLOW,
 104              'editingteacher' => CAP_ALLOW,
 105              'manager' => CAP_ALLOW
 106          )
 107      ),
 108  
 109      'mod/glossary:managecomments' => array(
 110  
 111          'riskbitmask' => RISK_SPAM,
 112  
 113          'captype' => 'write',
 114          'contextlevel' => CONTEXT_MODULE,
 115          'archetypes' => array(
 116              'teacher' => CAP_ALLOW,
 117              'editingteacher' => CAP_ALLOW,
 118              'manager' => CAP_ALLOW
 119          )
 120      ),
 121  
 122      'mod/glossary:import' => array(
 123  
 124          'riskbitmask' => RISK_SPAM,
 125  
 126          'captype' => 'write',
 127          'contextlevel' => CONTEXT_MODULE,
 128          'archetypes' => array(
 129              'teacher' => CAP_ALLOW,
 130              'editingteacher' => CAP_ALLOW,
 131              'manager' => CAP_ALLOW
 132          )
 133      ),
 134  
 135      'mod/glossary:export' => array(
 136  
 137          'captype' => 'read',
 138          'contextlevel' => CONTEXT_MODULE,
 139          'archetypes' => array(
 140              'teacher' => CAP_ALLOW,
 141              'editingteacher' => CAP_ALLOW,
 142              'manager' => CAP_ALLOW
 143          )
 144      ),
 145  
 146      'mod/glossary:approve' => array(
 147  
 148          'riskbitmask' => RISK_SPAM,
 149  
 150          'captype' => 'write',
 151          'contextlevel' => CONTEXT_MODULE,
 152          'archetypes' => array(
 153              'teacher' => CAP_ALLOW,
 154              'editingteacher' => CAP_ALLOW,
 155              'manager' => CAP_ALLOW
 156          )
 157      ),
 158  
 159      'mod/glossary:rate' => array(
 160  
 161          'captype' => 'write',
 162          'contextlevel' => CONTEXT_MODULE,
 163          'archetypes' => array(
 164              'teacher' => CAP_ALLOW,
 165              'editingteacher' => CAP_ALLOW,
 166              'manager' => CAP_ALLOW
 167          )
 168      ),
 169  
 170      'mod/glossary:viewrating' => array(
 171  
 172          'captype' => 'read',
 173          'contextlevel' => CONTEXT_MODULE,
 174          'archetypes' => array(
 175              'teacher' => CAP_ALLOW,
 176              'editingteacher' => CAP_ALLOW,
 177              'manager' => CAP_ALLOW
 178          )
 179      ),
 180  
 181      'mod/glossary:viewanyrating' => array(
 182  
 183          'riskbitmask' => RISK_PERSONAL,
 184          'captype' => 'read',
 185          'contextlevel' => CONTEXT_MODULE,
 186          'archetypes' => array(
 187              'teacher' => CAP_ALLOW,
 188              'editingteacher' => CAP_ALLOW,
 189              'manager' => CAP_ALLOW
 190          ),
 191          'clonepermissionsfrom' =>  'mod/glossary:viewrating'
 192      ),
 193  
 194      'mod/glossary:viewallratings' => array(
 195  
 196          'riskbitmask' => RISK_PERSONAL,
 197          'captype' => 'read',
 198          'contextlevel' => CONTEXT_MODULE,
 199          'archetypes' => array(
 200              'teacher' => CAP_ALLOW,
 201              'editingteacher' => CAP_ALLOW,
 202              'manager' => CAP_ALLOW
 203          ),
 204          'clonepermissionsfrom' =>  'mod/glossary:viewrating'
 205      ),
 206  
 207      'mod/glossary:exportentry' => array(
 208  
 209          'riskbitmask' => RISK_PERSONAL,
 210  
 211          'captype' => 'read',
 212          'contextlevel' => CONTEXT_MODULE,
 213          'archetypes' => array(
 214              'teacher' => CAP_ALLOW,
 215              'editingteacher' => CAP_ALLOW,
 216              'manager' => CAP_ALLOW
 217          )
 218      ),
 219  
 220      'mod/glossary:exportownentry' => array(
 221  
 222          'captype' => 'read',
 223          'contextlevel' => CONTEXT_MODULE,
 224          'archetypes' => array(
 225              'teacher' => CAP_ALLOW,
 226              'editingteacher' => CAP_ALLOW,
 227              'manager' => CAP_ALLOW,
 228              'student' => CAP_ALLOW,
 229          )
 230      ),
 231  
 232  );
 233  
 234