Skip to content

Commit

Permalink
MDL-15819 - Review the RISK_XXX flags on all quiz and question capabi…
Browse files Browse the repository at this point in the history
…lites.
  • Loading branch information
tjhunt committed Aug 13, 2008
1 parent 579ef29 commit e38099e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
13 changes: 4 additions & 9 deletions lib/db/access.php
@@ -1,4 +1,4 @@
<?php
<?php // $Id$
//
// Capability definitions for Moodle core.
//
Expand Down Expand Up @@ -778,9 +778,7 @@
),

'moodle/question:import' => array(

'riskbitmask' => RISK_XSS,

'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
Expand All @@ -791,7 +789,6 @@
),

'moodle/question:export' => array(

'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
Expand All @@ -802,7 +799,7 @@
),

'moodle/question:managecategory' => array(

'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
Expand All @@ -812,9 +809,7 @@
),

'moodle/question:manage' => array(

'riskbitmask' => RISK_XSS,

'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
Expand Down
14 changes: 5 additions & 9 deletions mod/quiz/db/access.php
@@ -1,4 +1,4 @@
<?php // $Id$
<?php // $Id$
/**
* Capability definitions for the quiz module.
*
Expand All @@ -9,7 +9,6 @@
// Ability to see that the quiz exists, and the basic information
// about it, for example the start date and time limit.
'mod/quiz:view' => array(

'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
Expand All @@ -23,7 +22,6 @@

// Ability to do the quiz as a 'student'.
'mod/quiz:attempt' => array(

'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
Expand All @@ -33,7 +31,7 @@

// Edit the quiz settings, add and remove questions.
'mod/quiz:manage' => array(

'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
Expand All @@ -44,7 +42,6 @@

// Preview the quiz.
'mod/quiz:preview' => array(

'captype' => 'write', // Only just a write.
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
Expand All @@ -56,7 +53,7 @@

// Manually grade and comment on student attempts at a question.
'mod/quiz:grade' => array(

'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
Expand All @@ -68,7 +65,7 @@

// View the quiz reports.
'mod/quiz:viewreports' => array(

'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
Expand All @@ -80,7 +77,7 @@

// Delete attempts using the overview report.
'mod/quiz:deleteattempts' => array(

'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_MODULE,
'legacy' => array(
Expand All @@ -89,5 +86,4 @@
)
)
);

?>

0 comments on commit e38099e

Please sign in to comment.