: // // component_name should be the same as the directory name of the mod or block. // // Core moodle capabilities are defined thus: // moodle/: // // Examples: mod/forum:viewpost // block/recent_activity:view // moodle/site:deleteuser // // The variable name for the capability definitions array follows the format // $__capabilities // // For the core capabilities, the variable is $moodle_capabilities. // NOTE: many Sloodle components relate directly to Moodle components. // In these cases, the standard capabilities for those components apply. // For example, Sloodle module configuration is covered by the Moodle standard capability: // moodle/course:manageactivities // Viewing and editing avatar details will be handled by the user profile capabilities. defined('MOODLE_INTERNAL') || die(); $capabilities = array( 'mod/sloodle:addinstance' => array( 'riskbitmask' => RISK_XSS, 'captype' => 'write', 'contextlevel' => CONTEXT_COURSE, 'archetypes' => array( 'editingteacher' => CAP_ALLOW, 'manager' => CAP_ALLOW ), 'clonepermissionsfrom' => 'moodle/course:manageactivities' ), // Considered a 'staff' member in SL 'mod/sloodle:staff' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_MODULE, 'legacy' => array( 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ), // Authorising objects to access Sloodle 'mod/sloodle:objectauth' => array( 'riskbitmask' => RISK_CONFIG, 'captype' => 'write', 'contextlevel' => CONTEXT_MODULE, 'legacy' => array( 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ), // Authorising user objects to access user-specific parts of Sloodle (e.g. blogging) 'mod/sloodle:userobjectauth' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_MODULE, 'legacy' => array( 'user' => CAP_ALLOW, 'guest' => CAP_PREVENT, 'student' => CAP_ALLOW, 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ), // Access and use classroom layout profiles 'mod/sloodle:uselayouts' => array( 'captype' => 'read', 'contextlevel' => CONTEXT_MODULE, 'legacy' => array( 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ), // Edit and delete classroom layout profiles 'mod/sloodle:editlayouts' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_MODULE, 'legacy' => array( 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ), // Register an avatar with their own account 'mod/sloodle:registeravatar' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_MODULE, 'legacy' => array( 'user' => CAP_ALLOW, 'guest' => CAP_PREVENT, 'student' => CAP_ALLOW, 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ), // Distribute objects to own avatar 'mod/sloodle:distributeself' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_MODULE, 'legacy' => array( 'guest' => CAP_PREVENT, 'student' => CAP_ALLOW, 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ), // Distribute objects to other avatars 'mod/sloodle:distributeothers' => array( 'riskbitmask' => RISK_SPAM, 'captype' => 'write', 'contextlevel' => CONTEXT_MODULE, 'legacy' => array( 'guest' => CAP_PREVENT, 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ), // Indicates that the user is involved in the course. Replaces pre-Moodle-2 course:view 'mod/sloodle:courseparticipate' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_COURSE, 'legacy' => array( 'guest' => CAP_PREVENT, 'student' => CAP_ALLOW, 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ), // Indicates that the user is allowed to use a controller. // Intended to replace courseparticipate where permissions can sensibly be set at the controller level. 'mod/sloodle:controllerparticipate' => array( 'captype' => 'write', 'contextlevel' => CONTEXT_MODULE, 'legacy' => array( 'guest' => CAP_PREVENT, 'student' => CAP_ALLOW, 'teacher' => CAP_ALLOW, 'editingteacher' => CAP_ALLOW, 'coursecreator' => CAP_ALLOW, 'manager' => CAP_ALLOW ) ), );