|
@@ -1,7 +1,11 @@
|
|
|
<?php
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * Capability definitions for the ia module.
|
|
|
|
|
|
|
+ * Capability definitions for the iAssign module.
|
|
|
|
|
+ * For instance, this is used when anyone, under role smaller then teacher, try to edit any iAssign activity, trying
|
|
|
|
|
+ * http://.../<your_moodle>/mod/iassign/view.php?action=edit&id=2&iassign_current=1&iassign_up=1&iassign_down=65
|
|
|
|
|
+ * then 'locallib.php!iassign->__construct(...)' block the access using
|
|
|
|
|
+ * "if (!has_capability('mod/iassign:evaluateiassign', $this->context, $USER->id))"
|
|
|
*
|
|
*
|
|
|
* The system has four possible values for a capability:
|
|
* The system has four possible values for a capability:
|
|
|
* - CAP_ALLOW
|
|
* - CAP_ALLOW
|
|
@@ -18,15 +22,18 @@
|
|
|
* - user - All users who login.
|
|
* - user - All users who login.
|
|
|
*
|
|
*
|
|
|
* @author Patricia Alves Rodrigues
|
|
* @author Patricia Alves Rodrigues
|
|
|
- * @author Leônidas O. Brandão
|
|
|
|
|
|
|
+ * @author Leo^idas de Oliveira Branda~o
|
|
|
|
|
+ *
|
|
|
|
|
+ * @version v 1.1 2023/05/25 additional explanation of has_capability(.)
|
|
|
* @version v 1.0 2010/09/27
|
|
* @version v 1.0 2010/09/27
|
|
|
* @package mod_iassign_db
|
|
* @package mod_iassign_db
|
|
|
* @since 2010/09/27
|
|
* @since 2010/09/27
|
|
|
- * @copyright iMatica (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
|
|
|
|
|
|
|
+ * @copyleft iMath (<a href="http://www.matematica.br">iMath</a>) - Computer Science Dep. of IME-USP (Brazil)
|
|
|
*
|
|
*
|
|
|
* <b>License</b>
|
|
* <b>License</b>
|
|
|
* - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
* - http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
|
|
*/
|
|
*/
|
|
|
|
|
+
|
|
|
$capabilities = array(
|
|
$capabilities = array(
|
|
|
'mod/iassign:view' => array(
|
|
'mod/iassign:view' => array(
|
|
|
'captype' => 'read',
|
|
'captype' => 'read',
|
|
@@ -125,4 +132,4 @@ $capabilities = array(
|
|
|
'manager' => CAP_ALLOW
|
|
'manager' => CAP_ALLOW
|
|
|
)
|
|
)
|
|
|
)
|
|
)
|
|
|
-);
|
|
|
|
|
|
|
+);
|