| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193 |
- <?php
- /**
- * Moodle capability definitions for the Sloodle module.
- *
- * 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.
- *
- * @package sloodle
- * @copyright Copyright (c) 2008 Sloodle (various contributors)
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3
- * @since Sloodle 0.3
- *
- * @contributor Peter R. Bloomfield
- * @contributor Edmund Edgar
- *
- */
- //
- // 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]/<component_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 follows the format
- // $<componenttype>_<component_name>_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.
- $mod_sloodle_capabilities = array(
- // 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,
- 'admin' => 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,
- 'admin' => 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,
- 'admin' => 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,
- 'admin' => 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,
- 'admin' => 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,
- 'admin' => 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,
- 'admin' => 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,
- 'admin' => 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,
- 'admin' => 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,
- 'admin' => CAP_ALLOW
- )
- ),
- );
- ?>
|