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_wiki
  21   * @author     Jordi Piguillem
  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/wiki: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/wiki:viewpage' => array(
  42  
  43          'captype' => 'read',
  44          'contextlevel' => CONTEXT_MODULE,
  45          'archetypes' => array(
  46              'guest' => CAP_ALLOW,
  47              'frontpage' => CAP_ALLOW,
  48              'student' => CAP_ALLOW,
  49              'teacher' => CAP_ALLOW,
  50              'editingteacher' => CAP_ALLOW,
  51              'manager' => CAP_ALLOW
  52          )
  53      ),
  54  
  55      'mod/wiki:editpage' => 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/wiki:createpage' => array(
  70  
  71          'riskbitmask' => RISK_SPAM,
  72  
  73          'captype' => 'write',
  74          'contextlevel' => CONTEXT_MODULE,
  75          'archetypes' => array(
  76              'student' => CAP_ALLOW,
  77              'teacher' => CAP_ALLOW,
  78              'editingteacher' => CAP_ALLOW,
  79              'manager' => CAP_ALLOW
  80          )
  81      ),
  82  
  83      'mod/wiki:viewcomment' => array(
  84  
  85          'captype' => 'read',
  86          'contextlevel' => CONTEXT_MODULE,
  87          'archetypes' => array(
  88              'student' => CAP_ALLOW,
  89              'teacher' => CAP_ALLOW,
  90              'editingteacher' => CAP_ALLOW,
  91              'manager' => CAP_ALLOW
  92          )
  93      ),
  94  
  95      'mod/wiki:editcomment' => 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/wiki:managecomment' => array(
 110  
 111          'captype' => 'write',
 112          'contextlevel' => CONTEXT_MODULE,
 113          'archetypes' => array(
 114              'teacher' => CAP_ALLOW,
 115              'editingteacher' => CAP_ALLOW,
 116              'manager' => CAP_ALLOW
 117          )
 118      ),
 119  
 120      'mod/wiki:managefiles' => array(
 121  
 122          'captype' => 'write',
 123          'contextlevel' => CONTEXT_MODULE,
 124          'archetypes' => array(
 125              'teacher' => CAP_ALLOW,
 126              'editingteacher' => CAP_ALLOW,
 127              'manager' => CAP_ALLOW
 128          )
 129      ),
 130  
 131      'mod/wiki:overridelock' => array(
 132  
 133          'captype' => 'write',
 134          'contextlevel' => CONTEXT_MODULE,
 135          'archetypes' => array(
 136              'teacher' => CAP_ALLOW,
 137              'editingteacher' => CAP_ALLOW,
 138              'manager' => CAP_ALLOW
 139          )
 140      ),
 141  
 142      'mod/wiki:managewiki' => array(
 143  
 144          'captype' => 'write',
 145          'contextlevel' => CONTEXT_MODULE,
 146          'archetypes' => array(
 147              'teacher' => CAP_ALLOW,
 148              'editingteacher' => CAP_ALLOW,
 149              'manager' => CAP_ALLOW
 150          )
 151      ),
 152  );