Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.
   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_chat
  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/chat: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/chat:chat' => array(
  42  
  43          'riskbitmask' => RISK_SPAM,
  44  
  45          'captype' => 'write',
  46          'contextlevel' => CONTEXT_MODULE,
  47          'archetypes' => array(
  48              'student' => CAP_ALLOW,
  49              'teacher' => CAP_ALLOW,
  50              'editingteacher' => CAP_ALLOW,
  51              'manager' => CAP_ALLOW
  52          )
  53      ),
  54  
  55      'mod/chat:readlog' => array(
  56  
  57          'captype' => 'read',
  58          'contextlevel' => CONTEXT_MODULE,
  59          'archetypes' => array(
  60              'student' => CAP_ALLOW,
  61              'teacher' => CAP_ALLOW,
  62              'editingteacher' => CAP_ALLOW,
  63              'manager' => CAP_ALLOW
  64          )
  65      ),
  66  
  67      'mod/chat:deletelog' => array(
  68  
  69          'captype' => 'write',
  70          'contextlevel' => CONTEXT_MODULE,
  71          'archetypes' => array(
  72              'teacher' => CAP_ALLOW,
  73              'editingteacher' => CAP_ALLOW,
  74              'manager' => CAP_ALLOW
  75          )
  76      ),
  77  
  78      'mod/chat:exportparticipatedsession' => array(
  79  
  80          'riskbitmask' => RISK_PERSONAL,
  81  
  82          'captype' => 'read',
  83          'contextlevel' => CONTEXT_MODULE,
  84          'archetypes' => array(
  85              'teacher' => CAP_ALLOW,
  86              'editingteacher' => CAP_ALLOW,
  87              'manager' => CAP_ALLOW,
  88              // Not student - nervous about allowing this by default.
  89          ),
  90  
  91      ),
  92  
  93      'mod/chat:exportsession' => array(
  94  
  95          'riskbitmask' => RISK_PERSONAL,
  96  
  97          'captype' => 'read',
  98          'contextlevel' => CONTEXT_MODULE,
  99          'archetypes' => array(
 100              'teacher' => CAP_ALLOW,
 101              'editingteacher' => CAP_ALLOW,
 102              'manager' => CAP_ALLOW,
 103          ),
 104      ),
 105  
 106      'mod/chat:view' => array(
 107          'captype' => 'read',
 108          'contextlevel' => CONTEXT_MODULE,
 109          'archetypes' => array(
 110              'user' => CAP_ALLOW,
 111              'guest' => CAP_ALLOW
 112          )
 113      )
 114  );