PageRenderTime 39ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/mod/lti/db/access.php

https://github.com/pauln/moodle
PHP | 94 lines | 50 code | 10 blank | 34 comment | 1 complexity | 25b290d193c2ff7fb26b37770da45f56 MD5 | raw file
  1. <?php
  2. // This file is part of Moodle - http://moodle.org/
  3. //
  4. // Moodle is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // Moodle is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License
  15. // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
  16. /**
  17. * This file contains the capabilities used by the lti module
  18. *
  19. * @package mod_lti
  20. * @copyright 2009 Marc Alier, Jordi Piguillem, Nikolas Galanis, marc.alier@upc.edu
  21. * @copyright 2009 Universitat Politecnica de Catalunya http://www.upc.edu
  22. * @author Marc Alier
  23. * @author Jordi Piguillem
  24. * @author Nikolas Galanis
  25. * @author Chris Scribner
  26. * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
  27. */
  28. defined('MOODLE_INTERNAL') || die;
  29. $capabilities = array(
  30. // Whether the user can see the link to the external tool and follow it.
  31. 'mod/lti:view' => array(
  32. 'captype' => 'read',
  33. 'contextlevel' => CONTEXT_MODULE,
  34. 'archetypes' => array(
  35. 'student' => CAP_ALLOW,
  36. 'teacher' => CAP_ALLOW,
  37. 'editingteacher' => CAP_ALLOW,
  38. 'manager' => CAP_ALLOW
  39. )
  40. ),
  41. // Add an External tool activity to a course.
  42. 'mod/lti:addinstance' => array(
  43. 'riskbitmask' => RISK_XSS,
  44. 'captype' => 'write',
  45. 'contextlevel' => CONTEXT_COURSE,
  46. 'archetypes' => array(
  47. 'editingteacher' => CAP_ALLOW,
  48. 'manager' => CAP_ALLOW
  49. ),
  50. 'clonepermissionsfrom' => 'moodle/course:manageactivities'
  51. ),
  52. // When the user arrives at the external tool, if they have this capability
  53. // in Moodle, then they are given the Instructor role in the remote system,
  54. // otherwise they are given Learner. See the lti_get_ims_role function.
  55. 'mod/lti:manage' => array(
  56. 'riskbitmask' => RISK_PERSONAL, // A bit of a guess, but seems likely.
  57. 'captype' => 'write',
  58. 'contextlevel' => CONTEXT_MODULE,
  59. 'archetypes' => array(
  60. 'teacher' => CAP_ALLOW,
  61. 'editingteacher' => CAP_ALLOW,
  62. 'manager' => CAP_ALLOW
  63. )
  64. ),
  65. // The ability to create or edit tool configurations for particular courses.
  66. 'mod/lti:addcoursetool' => array(
  67. 'captype' => 'write',
  68. 'contextlevel' => CONTEXT_COURSE,
  69. 'archetypes' => array(
  70. 'editingteacher' => CAP_ALLOW,
  71. 'manager' => CAP_ALLOW
  72. )
  73. ),
  74. // The ability to request the administrator to configure a particular
  75. // External tool globally.
  76. 'mod/lti:requesttooladd' => array(
  77. 'captype' => 'write',
  78. 'contextlevel' => CONTEXT_COURSE,
  79. 'archetypes' => array(
  80. 'editingteacher' => CAP_ALLOW,
  81. 'manager' => CAP_ALLOW
  82. )
  83. )
  84. );