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.     // Authorising user objects to access user-specific parts of Sloodle (e.g. blogging)
  77.     'mod/sloodle:userobjectauth' => array(
  78.         'captype' => 'write',
  79.         'contextlevel' => CONTEXT_MODULE,
  80.         'legacy' => array(
  81.             'user' => CAP_ALLOW,
  82.             'guest' => CAP_PREVENT,
  83.             'student' => CAP_ALLOW,
  84.             'teacher' => CAP_ALLOW,
  85.             'editingteacher' => CAP_ALLOW,
  86.             'admin' => CAP_ALLOW
  87.         )
  88.     ),
  89.     
  90.     
  91.     // Access and use classroom layout profiles
  92.     'mod/sloodle:uselayouts' => array(
  93.         'captype' => 'read',
  94.         'contextlevel' => CONTEXT_MODULE,
  95.         'legacy' => array(
  96.             'teacher' => CAP_ALLOW,
  97.             'editingteacher' => CAP_ALLOW,
  98.             'admin' => CAP_ALLOW
  99.         )
  100.     ),
  101.     
  102.     // Edit and delete classroom layout profiles
  103.     'mod/sloodle:editlayouts' => array(
  104.         'captype' => 'write',
  105.         'contextlevel' => CONTEXT_MODULE,
  106.         'legacy' => array(
  107.             'editingteacher' => CAP_ALLOW,
  108.             'admin' => CAP_ALLOW
  109.         )
  110.     ),
  111.     
  112.     
  113.     // Register an avatar with their own account
  114.     'mod/sloodle:registeravatar' => array(
  115.         'captype' => 'write',
  116.         'contextlevel' => CONTEXT_MODULE,
  117.         'legacy' => array(
  118.             'user' => CAP_ALLOW,
  119.             'guest' => CAP_PREVENT,
  120.             'student' => CAP_ALLOW,
  121.             'teacher' => CAP_ALLOW,
  122.             'editingteacher' => CAP_ALLOW,
  123.             'admin' => CAP_ALLOW
  124.         )
  125.     ),
  126.     
  127.     // Distribute objects to own avatar
  128.     'mod/sloodle:distributeself' => array(
  129.         'captype' => 'write',
  130.         'contextlevel' => CONTEXT_MODULE,
  131.         'legacy' => array(
  132.             'guest' => CAP_PREVENT,
  133.             'student' => CAP_ALLOW,
  134.             'teacher' => CAP_ALLOW,
  135.             'editingteacher' => CAP_ALLOW,
  136.             'admin' => CAP_ALLOW
  137.         )
  138.     ),
  139.     
  140.     // Distribute objects to other avatars
  141.     'mod/sloodle:distributeothers' => array(
  142.         'riskbitmask' => RISK_SPAM,
  143.         'captype' => 'write',
  144.         'contextlevel' => CONTEXT_MODULE,
  145.         'legacy' => array(
  146.             'guest' => CAP_PREVENT,
  147.             'editingteacher' => CAP_ALLOW,
  148.             'admin' => CAP_ALLOW
  149.         )
  150.     )
  151.  
  152. );
  153.  
  154. ?>

Documentation generated on Mon, 07 Jul 2008 12:32:10 +0100 by phpDocumentor 1.4.0