access.php 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?php
  2. /**
  3. * Capability definitions for the nasatlx module
  4. *
  5. * The capabilities are loaded into the database table when the module is
  6. * installed or updated. Whenever the capability definitions are updated,
  7. * the module version number should be bumped up.
  8. *
  9. * The system has four possible values for a capability:
  10. * CAP_ALLOW, CAP_PREVENT, CAP_PROHIBIT, and inherit (not set).
  11. *
  12. * It is important that capability names are unique. The naming convention
  13. * for capabilities that are specific to modules and blocks is as follows:
  14. * [mod/block]/<plugin_name>:<capabilityname>
  15. *
  16. * component_name should be the same as the directory name of the mod or block.
  17. *
  18. * Core moodle capabilities are defined thus:
  19. * moodle/<capabilityclass>:<capabilityname>
  20. *
  21. * Examples: mod/forum:viewpost
  22. * block/recent_activity:view
  23. * moodle/site:deleteuser
  24. *
  25. * The variable name for the capability definitions array is $capabilities
  26. *
  27. * @author Leônidas O. Brandão
  28. * @version v 1.0 2014/01/01
  29. * @since 2014/01/01
  30. * @package mod_nasatlx
  31. * @copyright 2014 LInE - http://line.ime.usp.br - Computer Science Dep. of IME-USP (Brazil)
  32. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  33. */
  34. defined('MOODLE_INTERNAL') || die();
  35. $capabilities = array(
  36. 'mod/nasatlx:view' => array(
  37. 'captype' => 'read',
  38. 'contextlevel' => CONTEXT_MODULE,
  39. 'legacy' => array(
  40. 'guest' => CAP_ALLOW,
  41. 'student' => CAP_ALLOW,
  42. 'teacher' => CAP_ALLOW,
  43. 'editingteacher' => CAP_ALLOW,
  44. 'coursecreator' => CAP_ALLOW,
  45. 'manager' => CAP_ALLOW
  46. )
  47. ),
  48. 'mod/nasatlx:editnasatlx' => array(
  49. 'captype' => 'write',
  50. 'contextlevel' => CONTEXT_MODULE,
  51. 'legacy' => array(
  52. 'editingteacher' => CAP_ALLOW,
  53. 'coursecreator' => CAP_ALLOW,
  54. 'manager' => CAP_ALLOW
  55. )
  56. ),
  57. 'mod/nasatlx:evaluatenasatlx' => array(
  58. 'riskbitmask' => RISK_XSS,
  59. 'captype' => 'write',
  60. 'contextlevel' => CONTEXT_MODULE,
  61. 'legacy' => array(
  62. 'teacher' => CAP_ALLOW,
  63. 'editingteacher' => CAP_ALLOW,
  64. 'coursecreator' => CAP_ALLOW,
  65. 'manager' => CAP_ALLOW
  66. )
  67. ),
  68. 'mod/nasatlx:viewnasatlxall' => array(
  69. 'captype' => 'read',
  70. 'contextlevel' => CONTEXT_MODULE,
  71. 'legacy' => array(
  72. 'teacher' => CAP_ALLOW,
  73. 'editingteacher' => CAP_ALLOW,
  74. 'coursecreator' => CAP_ALLOW,
  75. 'manager' => CAP_ALLOW
  76. )
  77. ),
  78. 'mod/nasatlx:viewreport' => array(
  79. 'captype' => 'read',
  80. 'contextlevel' => CONTEXT_MODULE,
  81. 'legacy' => array(
  82. 'teacher' => CAP_ALLOW,
  83. 'editingteacher' => CAP_ALLOW,
  84. 'coursecreator' => CAP_ALLOW,
  85. 'manager' => CAP_ALLOW
  86. )
  87. ),
  88. 'mod/nasatlx:submitnasatlx' => array(
  89. 'captype' => 'write',
  90. 'contextlevel' => CONTEXT_MODULE,
  91. 'legacy' => array(
  92. 'student' => CAP_ALLOW
  93. )
  94. ),
  95. 'mod/nasatlx:deletenasatlxnull' => array(
  96. 'riskbitmask' => RISK_XSS,
  97. 'captype' => 'write',
  98. 'contextlevel' => CONTEXT_MODULE,
  99. 'legacy' => array(
  100. 'editingteacher' => CAP_ALLOW,
  101. 'coursecreator' => CAP_ALLOW,
  102. 'manager' => CAP_ALLOW
  103. )
  104. ),
  105. 'mod/nasatlx:deletenasatlxnotnull' => array(
  106. 'riskbitmask' => RISK_XSS,
  107. 'captype' => 'write',
  108. 'contextlevel' => CONTEXT_MODULE,
  109. 'legacy' => array(
  110. 'manager' => CAP_ALLOW
  111. )
  112. ),
  113. 'mod/nasatlx:addinstance' => array(
  114. 'riskbitmask' => RISK_XSS,
  115. 'captype' => 'write',
  116. 'contextlevel' => CONTEXT_COURSE,
  117. 'archetypes' => array(
  118. 'editingteacher' => CAP_ALLOW,
  119. 'manager' => CAP_ALLOW
  120. ),
  121. 'clonepermissionsfrom' => 'moodle/course:manageactivities'
  122. ),
  123. );