Source for file access.php

Documentation is available at access.php

  1. <?php
  2.  
  3. /**
  4. * Moodle capability definitions for the Sloodle module.
  5. *
  6. * The capabilities are loaded into the database table when the module is
  7. * installed or updated. Whenever the capability definitions are updated,
  8. * the module version number should be bumped up.
  9. *
  10. @package sloodle
  11. @copyright Copyright (c) 2008 Sloodle (various contributors)
  12. @license http://www.gnu.org/licenses/gpl-3.0.html GNU GPL v3
  13. @since Sloodle 0.3
  14. *
  15. @contributor Peter R. Bloomfield
  16. *
  17. */
  18.  
  19. //
  20. // The system has four possible values for a capability:
  21. // CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
  22. //
  23. //
  24. // CAPABILITY NAMING CONVENTION
  25. //
  26. // It is important that capability names are unique. The naming convention
  27. // for capabilities that are specific to modules and blocks is as follows:
  28. //   [mod/block]/<component_name>:<capabilityname>
  29. //
  30. // component_name should be the same as the directory name of the mod or block.
  31. //
  32. // Core moodle capabilities are defined thus:
  33. //    moodle/<capabilityclass>:<capabilityname>
  34. //
  35. // Examples: mod/forum:viewpost
  36. //           block/recent_activity:view
  37. //           moodle/site:deleteuser
  38. //
  39. // The variable name for the capability definitions array follows the format
  40. //   $<componenttype>_<component_name>_capabilities
  41. //
  42. // For the core capabilities, the variable is $moodle_capabilities.
  43.  
  44. // NOTE: many Sloodle components relate directly to Moodle components.
  45. // In these cases, the standard capabilities for those components apply.
  46. // For example, Sloodle module configuration is covered by the Moodle standard capability:
  47. //  moodle/course:manageactivities
  48.  
  49. // Viewing and editing avatar details will be handled by the user profile capabilities.
  50.  
  51.  
  52. $mod_sloodle_capabilities array(
  53.  
  54.     // Considered a 'staff' member in SL
  55.     'mod/sloodle:staff' => array(
  56.         'captype' => 'write',
  57.         'contextlevel' => CONTEXT_MODULE,
  58.         'legacy' => array(
  59.             'teacher' => CAP_ALLOW,
  60.             'editingteacher' => CAP_ALLOW,
  61.             'admin' => CAP_ALLOW
  62.         )
  63.     ),
  64.  
  65.     // Authorising objects to access Sloodle
  66.     'mod/sloodle:objectauth' => array(
  67.         'riskbitmask' => RISK_CONFIG,
  68.         'captype' => 'write',
  69.         'contextlevel' => CONTEXT_MODULE,
  70.         'legacy' => array(
  71.             'editingteacher' => CAP_ALLOW,
  72.             'admin' => CAP_ALLOW
  73.         )
  74.     ),
  75.     
  76.     
  77.     // Access and use classroom layout profiles
  78.     'mod/sloodle:uselayouts' => array(
  79.         'captype' => 'read',
  80.         'contextlevel' => CONTEXT_MODULE,
  81.         'legacy' => array(
  82.             'teacher' => CAP_ALLOW,
  83.             'editingteacher' => CAP_ALLOW,
  84.             'admin' => CAP_ALLOW
  85.         )
  86.     ),
  87.     
  88.     // Edit and delete classroom layout profiles
  89.     'mod/sloodle:editlayouts' => array(
  90.         'captype' => 'write',
  91.         'contextlevel' => CONTEXT_MODULE,
  92.         'legacy' => array(
  93.             'editingteacher' => CAP_ALLOW,
  94.             'admin' => CAP_ALLOW
  95.         )
  96.     ),
  97.     
  98.     
  99.     // Register an avatar with their own account
  100.     'mod/sloodle:registeravatar' => array(
  101.         'captype' => 'write',
  102.         'contextlevel' => CONTEXT_MODULE,
  103.         'legacy' => array(
  104.             'student' => CAP_ALLOW,
  105.             'teacher' => CAP_ALLOW,
  106.             'editingteacher' => CAP_ALLOW,
  107.             'admin' => CAP_ALLOW
  108.         )
  109.     ),
  110.     
  111.     // Distribute objects to own avatar
  112.     'mod/sloodle:distributeself' => array(
  113.         'captype' => 'write',
  114.         'contextlevel' => CONTEXT_MODULE,
  115.         'legacy' => array(
  116.             'student' => CAP_ALLOW,
  117.             'teacher' => CAP_ALLOW,
  118.             'editingteacher' => CAP_ALLOW,
  119.             'admin' => CAP_ALLOW
  120.         )
  121.     ),
  122.     
  123.     // Distribute objects to other avatars
  124.     'mod/sloodle:distributeothers' => array(
  125.         'riskbitmask' => RISK_SPAM,
  126.         'captype' => 'write',
  127.         'contextlevel' => CONTEXT_MODULE,
  128.         'legacy' => array(
  129.             'editingteacher' => CAP_ALLOW,
  130.             'admin' => CAP_ALLOW
  131.         )
  132.     )
  133.  
  134. );
  135.  
  136. ?>

Documentation generated on Mon, 16 Jun 2008 15:56:04 +0100 by phpDocumentor 1.4.0