moodle/lib/db/access.php

2752 lines
75 KiB
PHP
Raw Normal View History

<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Capability definitions for Moodle core.
*
* The capabilities are loaded into the database table when the module is
* installed or updated. Whenever the capability definitions are updated,
* the module version number should be bumped up.
*
* The system has four possible values for a capability:
* CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
*
*
* CAPABILITY NAMING CONVENTION
*
* It is important that capability names are unique. The naming convention
* for capabilities that are specific to modules and blocks is as follows:
* [mod/block]/<plugin_name>:<capabilityname>
*
* component_name should be the same as the directory name of the mod or block.
*
* Core moodle capabilities are defined thus:
* moodle/<capabilityclass>:<capabilityname>
*
* Examples: mod/forum:viewpost
* block/recent_activity:view
* moodle/site:deleteuser
*
* The variable name for the capability definitions array is $capabilities
*
* For more information, take a look to the documentation available:
* - Access API: {@link https://moodledev.io/docs/apis/subsystems/access}
* - Upgrade API: {@link https://moodledev.io/docs/guides/upgrade}
*
* @package core_access
* @category access
* @copyright 2006 onwards Martin Dougiamas http://dougiamas.com
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
defined('MOODLE_INTERNAL') || die();
$capabilities = array(
'moodle/site:config' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG | RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
)
),
'moodle/site:configview' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
)
),
2006-09-08 08:46:26 +00:00
'moodle/site:readallmessages' => array(
'riskbitmask' => RISK_PERSONAL,
2006-09-08 08:46:26 +00:00
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW
2006-09-08 08:46:26 +00:00
)
),
'moodle/site:manageallmessaging' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/site:deleteanymessage' => array(
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/site:sendmessage' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW,
'user' => CAP_ALLOW
)
),
'moodle/site:senderrormessage' => [
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
)
],
'moodle/site:deleteownmessage' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
2006-09-08 08:46:26 +00:00
'moodle/site:approvecourse' => array(
'riskbitmask' => RISK_XSS,
2006-09-08 08:46:26 +00:00
'captype' => 'write',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
'manager' => CAP_ALLOW
2006-09-08 08:46:26 +00:00
)
),
'moodle/backup:backupcourse' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:backup'
),
'moodle/backup:backupsection' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/backup:backupcourse'
),
'moodle/backup:backupactivity' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/backup:backupcourse'
),
'moodle/backup:backuptargetimport' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/backup:backupcourse'
),
'moodle/backup:downloadfile' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:backupdownload'
),
'moodle/backup:configure' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/backup:userinfo' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/backup:anonymise' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/restore:restorecourse' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:restore'
),
'moodle/restore:restoresection' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/restore:restorecourse'
),
'moodle/restore:restoreactivity' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/restore:restorecourse'
),
'moodle/restore:viewautomatedfilearea' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
),
'moodle/restore:restoretargetimport' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:import'
),
'moodle/restore:uploadfile' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:backupupload'
),
'moodle/restore:configure' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/restore:rolldates' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/restore:userinfo' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/restore:createuser' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/site:manageblocks' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
2006-09-13 04:09:31 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/site:accessallgroups' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/site:viewanonymousevents' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'manager' => CAP_ALLOW,
)
),
2006-08-09 09:16:35 +00:00
'moodle/site:viewfullnames' => array(
2006-08-09 09:16:35 +00:00
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
2006-08-09 09:16:35 +00:00
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2006-08-09 09:16:35 +00:00
)
),
// In reports that give lists of users, extra information about each user's
// identity (the fields configured in site option showuseridentity) will be
// displayed to users who have this capability.
'moodle/site:viewuseridentity' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2006-08-15 04:13:22 +00:00
'moodle/site:viewreports' => array(
'riskbitmask' => RISK_PERSONAL,
2006-08-15 04:13:22 +00:00
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2006-08-15 04:13:22 +00:00
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2006-08-15 04:13:22 +00:00
)
),
'moodle/site:trustcontent' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/site:uploadusers' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
// Permission to manage filter setting overrides in subcontexts.
'moodle/filter:manage' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW,
)
),
'moodle/user:create' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/user:delete' => array(
'riskbitmask' => RISK_PERSONAL | RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/user:update' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/user:viewdetails' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'guest' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/user:viewalldetails' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/user:update'
),
'moodle/user:viewlastip' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/user:update'
),
'moodle/user:viewhiddendetails' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/user:loginas' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS | RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
// can the user manage the system default profile page?
'moodle/user:managesyspages' => array(
'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
// can the user manage another user's profile page?
'moodle/user:manageblocks' => array(
'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_USER
),
// can the user manage their own profile page?
'moodle/user:manageownblocks' => array(
'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
// can the user manage their own files?
'moodle/user:manageownfiles' => array(
'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
// Can the user ignore the setting userquota?
// The permissions are cloned from ignorefilesizelimits as it was partly used for that purpose.
'moodle/user:ignoreuserquota' => array(
'riskbitmap' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'clonepermissionsfrom' => 'moodle/course:ignorefilesizelimits'
),
// can the user manage the system default dashboard page?
'moodle/my:configsyspages' => array(
'riskbitmap' => RISK_SPAM | RISK_PERSONAL | RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/role:assign' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/role:review' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
// The ability to override the permissions for any capability.
'moodle/role:override' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
// The ability to override the permissions for 'safe' capabilities (those without risks).
// If a user has moodle/role:override then you should not check this capability.
'moodle/role:safeoverride' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW
)
),
'moodle/role:manage' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/role:switchroles' => array(
'riskbitmask' => RISK_XSS | RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
// Create, update and delete course categories. (Deleting a course category
// does not let you delete the courses it contains, unless you also have
// moodle/course: delete.) Creating and deleting requires this permission in
// the parent category.
'moodle/category:manage' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/category:update'
),
'moodle/category:viewcourselist' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
'guest' => CAP_ALLOW,
'user' => CAP_ALLOW,
)
),
'moodle/category:viewhiddencategories' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/category:visibility'
),
2010-04-23 09:05:56 +00:00
// create, delete, move cohorts in system and course categories,
// (cohorts with component !== null can be only moved)
'moodle/cohort:manage' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
2010-04-23 09:05:56 +00:00
'manager' => CAP_ALLOW
)
),
// add and remove cohort members (only for cohorts where component !== null)
'moodle/cohort:assign' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
2010-04-23 09:05:56 +00:00
'manager' => CAP_ALLOW
)
),
// View visible and hidden cohorts defined in the current context.
2010-04-23 09:05:56 +00:00
'moodle/cohort:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2010-04-23 09:05:56 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2023-03-07 13:28:02 +11:00
'moodle/cohort:configurecustomfields' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'clonepermissionsfrom' => 'moodle/site:config'
),
2023-08-09 11:02:49 +10:00
'moodle/group:configurecustomfields' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'clonepermissionsfrom' => 'moodle/site:config'
),
'moodle/course:create' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:creategroupconversations' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:request' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSECAT,
),
'moodle/course:delete' => array(
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/course:update' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
)
),
/* review course enrolments - no group restrictions, it is really full access to all participants info*/
'moodle/course:enrolreview' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW,
)
),
/* add, remove, hide enrol instances in courses */
'moodle/course:enrolconfig' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW,
)
),
'moodle/course:reviewotherusers' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW,
),
'clonepermissionsfrom' => 'moodle/role:assign'
),
'moodle/course:bulkmessaging' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2006-09-11 08:56:23 +00:00
'moodle/course:viewhiddenuserfields' => array(
'riskbitmask' => RISK_PERSONAL,
2008-07-28 12:31:29 +00:00
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2008-07-28 12:31:29 +00:00
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2008-07-28 12:31:29 +00:00
)
),
2006-09-11 08:56:23 +00:00
'moodle/course:viewhiddencourses' => array(
2006-09-11 08:56:23 +00:00
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2006-09-11 08:56:23 +00:00
)
),
'moodle/course:visibility' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2006-08-15 04:13:22 +00:00
'moodle/course:managefiles' => array(
'riskbitmask' => RISK_XSS,
2006-08-15 04:13:22 +00:00
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2006-08-15 04:13:22 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2006-08-15 04:13:22 +00:00
)
),
'moodle/course:ignoreavailabilityrestrictions' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
),
'clonepermissionsfrom' => 'moodle/course:viewhiddenactivities'
),
'moodle/course:ignorefilesizelimits' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
)
),
'moodle/course:manageactivities' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:activityvisibility' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:viewhiddenactivities' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:viewparticipants' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:changefullname' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:update'
),
'moodle/course:changeshortname' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:update'
),
'moodle/course:changelockedcustomfields' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/course:configurecustomfields' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'clonepermissionsfrom' => 'moodle/site:config'
),
'moodle/course:renameroles' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:update'
),
'moodle/course:changeidnumber' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:update'
),
'moodle/course:changecategory' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:update'
),
'moodle/course:changesummary' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:update'
),
// Ability to set a forced language for a course or activity.
'moodle/course:setforcedlanguage' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:update'
),
'moodle/site:viewparticipants' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/course:isincompletionreports' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'student' => CAP_ALLOW,
),
),
'moodle/course:viewscales' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:managescales' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:managegroups' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2006-08-15 04:13:22 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2006-08-15 04:13:22 +00:00
)
),
MDL-68093 groups: Add visibility and participation settings These new settings are designed to enchance user privacy surrounding groups. They allow groups to be configured so that users outside the group cannot see the group, so that users in the group cannot see each other, or so that users cannot see the group at all, even if they are in it. This avoids issues where a group may be assigned based on sensitive personal information (such as a person requiring special arrangements due to a disability). By default, groups are visible to all and available for participation in activities, which maintains the current behaviour. For performance, a new cache has been added to track the number of groups on a course that are not visible to non-members. This allows us to revert to the existing behaviour if the new features are not being used at all on a course, and only apply the new visibility conditions if they are. Users who have the moodle/course:viewhiddengroups capability should be concious of exposing hidden groups when showing their screen to other users. The "Switch role to..." feature can be used to show a course page on screen without exposing private availability conditions, for example. The changes cover several specific areas: * grouplib functions, which most code should use to get lists of groups and members (this includes the participants page). * Activities supporting group overrides will not allow overrides for groups that are hidden from all users. * Activities supporting separate/visible groups modes will only allow groups with the new "participation" flag enabled to be selected. * Group messaging will be disabled for groups where members cannot see each other, or cannot see the group at all.
2022-09-06 09:14:24 +01:00
'moodle/course:viewhiddengroups' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'READ',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2006-08-15 04:13:22 +00:00
'moodle/course:reset' => array(
'riskbitmask' => RISK_DATALOSS,
2006-08-15 04:13:22 +00:00
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:viewsuspendedusers' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:tag' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
),
'clonepermissionsfrom' => 'moodle/course:update'
),
'moodle/blog:view' => array(
'captype' => 'read',
2009-10-30 07:26:11 +00:00
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
2009-10-30 07:26:11 +00:00
'guest' => CAP_ALLOW,
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2009-10-30 07:26:11 +00:00
)
),
'moodle/blog:search' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'guest' => CAP_ALLOW,
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2009-10-30 07:26:11 +00:00
'moodle/blog:viewdrafts' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
2009-10-30 07:26:11 +00:00
)
),
'moodle/blog:create' => array( // works in CONTEXT_SYSTEM only
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/blog:manageentries' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
2009-10-30 07:26:11 +00:00
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2009-10-30 07:26:11 +00:00
2009-09-04 00:36:43 +00:00
'moodle/blog:manageexternal' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
2009-09-04 00:36:43 +00:00
'student' => CAP_ALLOW,
'user' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2009-09-04 00:36:43 +00:00
)
),
'moodle/calendar:manageownentries' => array( // works in CONTEXT_SYSTEM only
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'user' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/calendar:managegroupentries' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/calendar:manageentries' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/user:editprofile' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/user:editownprofile' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'guest' => CAP_PROHIBIT,
'user' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/user:changeownpassword' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'guest' => CAP_PROHIBIT,
'user' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
// The next 3 might make no sense for some roles, e.g teacher, etc.
// since the next level up is site. These are more for the parent role
'moodle/user:readuserposts' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/user:readuserblogs' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
// designed for parent role - not used in legacy roles
'moodle/user:viewuseractivitiesreport' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
)
),
2008-07-28 12:31:29 +00:00
//capabilities designed for the new message system configuration
'moodle/user:editmessageprofile' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/user:editownmessageprofile' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'guest' => CAP_PROHIBIT,
'user' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2007-08-09 21:51:09 +00:00
'moodle/question:managecategory' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2007-08-09 21:51:09 +00:00
//new in moodle 1.9
'moodle/question:add' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
2007-08-09 21:51:09 +00:00
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2007-08-09 21:51:09 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2007-08-09 21:51:09 +00:00
),
'clonepermissionsfrom' => 'moodle/question:manage'
),
2007-08-09 21:51:09 +00:00
'moodle/question:editmine' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
2007-08-09 21:51:09 +00:00
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2007-08-09 21:51:09 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2007-08-09 21:51:09 +00:00
),
'clonepermissionsfrom' => 'moodle/question:manage'
2007-08-09 21:51:09 +00:00
),
'moodle/question:editall' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
2007-08-09 21:51:09 +00:00
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2007-08-09 21:51:09 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2007-08-09 21:51:09 +00:00
),
'clonepermissionsfrom' => 'moodle/question:manage'
2007-08-09 21:51:09 +00:00
),
'moodle/question:viewmine' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2007-08-09 21:51:09 +00:00
),
'clonepermissionsfrom' => 'moodle/question:manage'
),
2007-08-09 21:51:09 +00:00
'moodle/question:viewall' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2007-08-09 21:51:09 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2007-08-09 21:51:09 +00:00
),
'clonepermissionsfrom' => 'moodle/question:manage'
2007-08-09 21:51:09 +00:00
),
'moodle/question:usemine' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2007-08-09 21:51:09 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2007-08-09 21:51:09 +00:00
),
'clonepermissionsfrom' => 'moodle/question:manage'
2007-08-09 21:51:09 +00:00
),
'moodle/question:useall' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2007-08-09 21:51:09 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2007-08-09 21:51:09 +00:00
),
'clonepermissionsfrom' => 'moodle/question:manage'
),
2007-08-09 21:51:09 +00:00
'moodle/question:movemine' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2007-08-09 21:51:09 +00:00
),
'clonepermissionsfrom' => 'moodle/question:manage'
),
2007-08-09 21:51:09 +00:00
'moodle/question:moveall' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2007-08-09 21:51:09 +00:00
),
'clonepermissionsfrom' => 'moodle/question:manage'
),
2007-08-09 21:51:09 +00:00
//END new in moodle 1.9
// Configure the installed question types.
'moodle/question:config' => array(
'riskbitmask' => RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
// While attempting questions, the ability to flag particular questions for later reference.
'moodle/question:flag' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
// Controls whether the user can tag his own questions.
'moodle/question:tagmine' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/question:editmine'
),
// Controls whether the user can tag all questions.
'moodle/question:tagall' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/question:editall'
),
'moodle/site:doclinks' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
2006-09-05 08:50:23 +00:00
),
2006-09-05 08:50:23 +00:00
'moodle/course:sectionvisibility' => array(
2006-09-05 08:50:23 +00:00
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2006-09-05 08:50:23 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2006-09-05 08:50:23 +00:00
)
),
'moodle/course:useremail' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2006-09-05 08:50:23 +00:00
'moodle/course:viewhiddensections' => array(
'captype' => 'read',
2006-09-05 08:50:23 +00:00
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2006-09-05 08:50:23 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2006-09-05 08:50:23 +00:00
)
),
2006-09-05 08:50:23 +00:00
'moodle/course:setcurrentsection' => array(
2006-09-05 08:50:23 +00:00
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2006-09-05 08:50:23 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2006-09-05 08:50:23 +00:00
)
),
'moodle/course:movesections' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:update'
),
'moodle/site:mnetlogintoremote' => array(
2006-09-05 08:50:23 +00:00
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
2006-09-05 08:50:23 +00:00
)
),
'moodle/grade:viewall' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE, // and CONTEXT_USER
'archetypes' => array(
'teacher' => CAP_ALLOW,
2006-09-05 08:50:23 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
),
'moodle/grade:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'student' => CAP_ALLOW
)
),
'moodle/grade:viewhidden' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:viewcoursegrades'
),
'moodle/grade:import' => array(
'riskbitmask' => RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:managegrades'
),
'moodle/grade:export' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:managegrades'
),
'moodle/grade:manage' => array(
'riskbitmask' => RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:managegrades'
),
'moodle/grade:edit' => array(
'riskbitmask' => RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:managegrades'
),
// ability to define advanced grading forms in activities either from scratch
// or from a shared template
'moodle/grade:managegradingforms' => array(
'riskbitmask' => RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:managegrades'
),
// ability to save a grading form as a new shared template and eventually edit
// and remove own templates (templates originally shared by that user)
'moodle/grade:sharegradingforms' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
// ability to edit and remove any shared template, even those originally shared
// by other users
'moodle/grade:managesharedforms' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/grade:manageoutcomes' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:managegrades'
),
'moodle/grade:manageletters' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:managegrades'
),
'moodle/grade:hide' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/grade:lock' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/grade:unlock' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/my:manageblocks' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
'moodle/notes:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/notes:manage' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
2007-07-31 05:59:32 +00:00
'moodle/tag:manage' => array(
'riskbitmask' => RISK_SPAM,
2007-07-31 05:59:32 +00:00
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
2007-07-31 05:59:32 +00:00
)
2007-07-31 07:34:03 +00:00
),
'moodle/tag:edit' => array(
'riskbitmask' => RISK_SPAM,
2007-07-31 07:34:03 +00:00
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
2007-08-11 03:25:23 +00:00
)
),
2012-09-20 09:12:11 +01:00
'moodle/tag:flag' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
2007-08-11 03:25:23 +00:00
'moodle/tag:editblocks' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
2007-07-31 07:34:03 +00:00
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2007-07-31 07:34:03 +00:00
)
),
'moodle/block:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'guest' => CAP_ALLOW,
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
'moodle/block:edit' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/portfolio:export' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
2009-07-24 02:44:44 +00:00
),
'moodle/comment:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'frontpage' => CAP_ALLOW,
'guest' => CAP_ALLOW,
2009-07-24 02:44:44 +00:00
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2009-07-24 02:44:44 +00:00
)
),
'moodle/comment:post' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2009-07-24 02:44:44 +00:00
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2009-07-24 02:44:44 +00:00
)
),
'moodle/comment:delete' => array(
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
2009-07-24 02:44:44 +00:00
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
2009-07-24 02:44:44 +00:00
)
),
'moodle/webservice:createtoken' => array(
'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_SPAM | RISK_PERSONAL | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/webservice:managealltokens' => array(
'riskbitmask' => RISK_CONFIG | RISK_DATALOSS | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array()
),
'moodle/webservice:createmobiletoken' => array(
'riskbitmask' => RISK_SPAM | RISK_PERSONAL,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
'moodle/rating:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/rating:viewany' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/rating:viewall' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/rating:rate' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:markcomplete' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/course:overridecompletion' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
// Badges.
'moodle/badges:manageglobalsettings' => array(
'riskbitmask' => RISK_DATALOSS | RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW,
)
),
// View available badges without earning them.
'moodle/badges:viewbadges' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'user' => CAP_ALLOW,
)
),
// Manage badges on own private badges page.
'moodle/badges:manageownbadges' => array(
'riskbitmap' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
// View public badges in other users' profiles.
'moodle/badges:viewotherbadges' => array(
'riskbitmap' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
// Earn badge.
'moodle/badges:earnbadge' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'user' => CAP_ALLOW,
)
),
// Create/duplicate badges.
'moodle/badges:createbadge' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Delete badges.
'moodle/badges:deletebadge' => array(
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Set up/edit badge details.
'moodle/badges:configuredetails' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Set up/edit criteria of earning a badge.
'moodle/badges:configurecriteria' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Configure badge messages.
'moodle/badges:configuremessages' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Award badge to a user.
'moodle/badges:awardbadge' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Revoke badge from a user.
'moodle/badges:revokebadge' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// View users who earned a specific badge without being able to award a badge.
'moodle/badges:viewawarded' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
'moodle/site:forcelanguage' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
)
),
// Perform site-wide search queries through the search API.
'moodle/search:query' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'guest' => CAP_ALLOW,
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
// Competencies.
'moodle/competency:competencymanage' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/competency:competencyview' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
'user' => CAP_ALLOW
),
),
'moodle/competency:competencygrade' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE, // And CONTEXT_USER.
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
),
// Course competencies.
'moodle/competency:coursecompetencymanage' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
),
'moodle/competency:coursecompetencyconfigure' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:coursecompetencygradable' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'student' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:isincompletionreports'
),
'moodle/competency:coursecompetencyview' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'user' => CAP_ALLOW
),
),
// Evidence.
'moodle/competency:evidencedelete' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
),
'clonepermissionsfrom' => 'moodle/site:config'
),
// User plans.
'moodle/competency:planmanage' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:planmanagedraft' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:planmanageown' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
),
),
'moodle/competency:planmanageowndraft' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
),
),
'moodle/competency:planview' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:planviewdraft' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:planviewown' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'user' => CAP_ALLOW
),
),
'moodle/competency:planviewowndraft' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
),
),
'moodle/competency:planrequestreview' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/competency:planrequestreviewown' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
'moodle/competency:planreview' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:plancomment' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:plancommentown' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'user' => CAP_ALLOW
),
),
// User competencies.
'moodle/competency:usercompetencyview' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_USER, // And CONTEXT_COURSE.
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'teacher' => CAP_ALLOW
)
),
'moodle/competency:usercompetencyrequestreview' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
)
),
'moodle/competency:usercompetencyrequestreviewown' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
'moodle/competency:usercompetencyreview' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:usercompetencycomment' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:usercompetencycommentown' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'user' => CAP_ALLOW
),
),
// Template.
'moodle/competency:templatemanage' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/analytics:listinsights' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
'moodle/analytics:managemodels' => array(
'riskbitmask' => RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:templateview' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSECAT,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
// User evidence.
'moodle/competency:userevidencemanage' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/competency:userevidencemanageown' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'user' => CAP_ALLOW
),
),
'moodle/competency:userevidenceview' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'manager' => CAP_ALLOW
),
),
'moodle/site:maintenanceaccess' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
)
),
// Allow message any user, regardlesss of the privacy preferences for messaging.
'moodle/site:messageanyuser' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
),
// Context locking/unlocking.
'moodle/site:managecontextlocks' => [
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
],
],
// Manual completion toggling.
'moodle/course:togglecompletion' => [
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
'user' => CAP_ALLOW,
],
],
'moodle/analytics:listowninsights' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
)
),
// Set display option buttons to an H5P content.
'moodle/h5p:setdisplayoptions' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
)
),
// Allow to deploy H5P content.
'moodle/h5p:deploy' => array(
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Allow to update H5P content-type libraries.
'moodle/h5p:updatelibraries' => [
'riskbitmask' => RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => [
'manager' => CAP_ALLOW,
]
],
// Allow users to recommend activities in the activity chooser.
'moodle/course:recommendactivity' => [
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => [
'manager' => CAP_ALLOW,
]
],
// Content bank capabilities.
'moodle/contentbank:access' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
'moodle/contentbank:upload' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Delete any content from the content bank.
'moodle/contentbank:deleteanycontent' => [
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
]
],
// Delete content created by yourself.
'moodle/contentbank:deleteowncontent' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'user' => CAP_ALLOW,
]
],
// Manage (rename, move, publish, share, etc.) any content from the content bank.
'moodle/contentbank:manageanycontent' => [
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
)
],
// Manage (rename, move, publish, share, etc.) content created by yourself.
'moodle/contentbank:manageowncontent' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
],
// Allow users to create/edit content within the content bank.
'moodle/contentbank:useeditor' => [
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
],
// Allow users to download content.
'moodle/contentbank:downloadcontent' => [
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
]
],
// Allow users to copy content.
'moodle/contentbank:copyanycontent' => [
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
]
],
// Allow users to copy content.
'moodle/contentbank:copycontent' => [
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
]
],
// Allow users to download course content.
'moodle/course:downloadcoursecontent' => [
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
)
],
// Allow users to configure download course content functionality within a course, if the feature is available.
'moodle/course:configuredownloadcontent' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
],
// Allow to manage payment accounts.
'moodle/payment:manageaccounts' => [
'captype' => 'write',
'riskbitmask' => RISK_PERSONAL | RISK_CONFIG | RISK_DATALOSS,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [],
],
// Allow to view payments.
'moodle/payment:viewpayments' => [
'captype' => 'read',
'riskbitmask' => RISK_PERSONAL,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [],
],
// Allow users to view hidden content.
'moodle/contentbank:viewunlistedcontent' => [
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
]
],
// Allow users to view custom reports.
'moodle/reportbuilder:view' => [
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => [
'user' => CAP_ALLOW,
],
],
// Allow users to view all custom reports.
'moodle/reportbuilder:viewall' => [
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => [],
],
// Allow users to create/edit their own custom reports.
'moodle/reportbuilder:edit' => [
'captype' => 'write',
'riskbitmap' => RISK_PERSONAL,
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => [
'manager' => CAP_ALLOW,
],
],
// Allow users to create/edit all custom reports.
'moodle/reportbuilder:editall' => [
'captype' => 'write',
'riskbitmap' => RISK_PERSONAL,
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => [],
],
// Allow users to schedule reports as other users.
'moodle/reportbuilder:scheduleviewas' => [
'captype' => 'read',
'riskbitmap' => RISK_PERSONAL,
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => [],
],
// Allow users to share activities to MoodleNet.
'moodle/moodlenet:shareactivity' => [
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW,
]
],
// Allow users to configure course communication rooms.
'moodle/course:configurecoursecommunication' => [
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW,
]
],
// Allow users to share courses to MoodleNet.
'moodle/moodlenet:sharecourse' => [
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => [
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW,
]
],
);