access.php 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. <?php
  2. /**
  3. * Capability definitions for the ia module.
  4. *
  5. * The system has four possible values for a capability:
  6. * - CAP_ALLOW
  7. * - CAP_PREVENT
  8. * - CAP_PROHIBIT
  9. * - CAP_INHERIT
  10. * Hardening_new_Roles_system: <a href="http://docs.moodle.org/en/Development">http://docs.moodle.org/en/Development</a>
  11. * - manager - manageristrators can do anything at all courses.
  12. * - coursecreator - Creators can create new courses to courses and act as teachers.
  13. * - editingteacher - Teachers can do everything on a course, change, and evaluate activities.
  14. * - teacher - Moderators can interact and evaluate but can not modify the activities.
  15. * - student - Students usually have fewer privileges on a course.
  16. * - guest - Guests have minimal privileges and can not publish texts.
  17. * - user - All users who login.
  18. *
  19. * @author Patricia Alves Rodrigues
  20. * @author Leônidas O. Brandão
  21. * @version v 1.0 2010/09/27
  22. * @package mod_iassign_db
  23. * @since 2010/09/27
  24. * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
  25. *
  26. * <b>License</b>
  27. * - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  28. */
  29. $capabilities = array(
  30. 'mod/iassign:view' => array(
  31. 'captype' => 'read',
  32. 'contextlevel' => CONTEXT_MODULE,
  33. 'legacy' => array(
  34. 'guest' => CAP_ALLOW,
  35. 'student' => CAP_ALLOW,
  36. 'teacher' => CAP_ALLOW,
  37. 'editingteacher' => CAP_ALLOW,
  38. 'coursecreator' => CAP_ALLOW,
  39. 'manager' => CAP_ALLOW
  40. )
  41. ),
  42. 'mod/iassign:editiassign' => array(
  43. 'captype' => 'write',
  44. 'contextlevel' => CONTEXT_MODULE,
  45. 'legacy' => array(
  46. 'editingteacher' => CAP_ALLOW,
  47. 'coursecreator' => CAP_ALLOW,
  48. 'manager' => CAP_ALLOW
  49. )
  50. ),
  51. 'mod/iassign:evaluateiassign' => array(
  52. 'riskbitmask' => RISK_XSS,
  53. 'captype' => 'write',
  54. 'contextlevel' => CONTEXT_MODULE,
  55. 'legacy' => array(
  56. 'teacher' => CAP_ALLOW,
  57. 'editingteacher' => CAP_ALLOW,
  58. 'coursecreator' => CAP_ALLOW,
  59. 'manager' => CAP_ALLOW
  60. )
  61. ),
  62. 'mod/iassign:viewiassignall' => array(
  63. 'captype' => 'read',
  64. 'contextlevel' => CONTEXT_MODULE,
  65. 'legacy' => array(
  66. 'teacher' => CAP_ALLOW,
  67. 'editingteacher' => CAP_ALLOW,
  68. 'coursecreator' => CAP_ALLOW,
  69. 'manager' => CAP_ALLOW
  70. )
  71. ),
  72. 'mod/iassign:viewreport' => array(
  73. 'captype' => 'read',
  74. 'contextlevel' => CONTEXT_MODULE,
  75. 'legacy' => array(
  76. 'teacher' => CAP_ALLOW,
  77. 'editingteacher' => CAP_ALLOW,
  78. 'coursecreator' => CAP_ALLOW,
  79. 'manager' => CAP_ALLOW
  80. )
  81. ),
  82. 'mod/iassign:submitiassign' => array(
  83. 'captype' => 'write',
  84. 'contextlevel' => CONTEXT_MODULE,
  85. 'legacy' => array(
  86. 'student' => CAP_ALLOW
  87. )
  88. ),
  89. 'mod/iassign:deleteiassignnull' => array(
  90. 'riskbitmask' => RISK_XSS,
  91. 'captype' => 'write',
  92. 'contextlevel' => CONTEXT_MODULE,
  93. 'legacy' => array(
  94. 'editingteacher' => CAP_ALLOW,
  95. 'coursecreator' => CAP_ALLOW,
  96. 'manager' => CAP_ALLOW
  97. )
  98. ),
  99. 'mod/iassign:deleteiassignnotnull' => array(
  100. 'riskbitmask' => RISK_XSS,
  101. 'captype' => 'write',
  102. 'contextlevel' => CONTEXT_MODULE,
  103. 'legacy' => array(
  104. 'manager' => CAP_ALLOW
  105. )
  106. ),
  107. 'mod/iassign:addinstance' => array(
  108. 'riskbitmask' => RISK_XSS,
  109. 'captype' => 'write',
  110. 'contextlevel' => CONTEXT_COURSE,
  111. 'archetypes' => array(
  112. 'editingteacher' => CAP_ALLOW,
  113. 'manager' => CAP_ALLOW
  114. ),
  115. 'clonepermissionsfrom' => 'moodle/course:manageactivities'
  116. ),
  117. 'mod/iassign:runautoevaluate' => array(
  118. 'captype' => 'read',
  119. 'contextlevel' => CONTEXT_MODULE,
  120. 'legacy' => array(
  121. 'teacher' => CAP_ALLOW,
  122. 'editingteacher' => CAP_ALLOW,
  123. 'coursecreator' => CAP_ALLOW,
  124. 'manager' => CAP_ALLOW
  125. )
  126. )
  127. );