Skip to content

Commit

Permalink
MDL-19125 module restrictions: addinstance capabilities for all mods
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Mar 15, 2012
1 parent 9665ecd commit 88eca3c
Show file tree
Hide file tree
Showing 60 changed files with 333 additions and 42 deletions.
12 changes: 12 additions & 0 deletions mod/assignment/db/access.php
Expand Up @@ -39,6 +39,18 @@
)
),

'mod/assignment:addinstance' => array(
'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),

'mod/assignment:submit' => array(

'captype' => 'write',
Expand Down
1 change: 1 addition & 0 deletions mod/assignment/lang/en/assignment.php
Expand Up @@ -32,6 +32,7 @@
$string['allowresubmit'] = 'Allow resubmitting';
$string['allowresubmit_help'] = 'If enabled, students will be allowed to resubmit assignments after they have been graded (for them to be re-graded).';
$string['alreadygraded'] = 'Your assignment has already been graded and resubmission is not allowed.';
$string['assignment:addinstance'] = 'Add a new assignment';
$string['assignmentdetails'] = 'Assignment details';
$string['assignment:exportownsubmission'] = 'Export own submission';
$string['assignment:exportsubmission'] = 'Export submission';
Expand Down
4 changes: 2 additions & 2 deletions mod/assignment/version.php
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->version = 2012030700; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012030100.04; // Requires this Moodle version
$module->component = 'mod_assignment'; // Full name of the plugin (used for diagnostics)
$module->cron = 60;
14 changes: 12 additions & 2 deletions mod/chat/db/access.php
Expand Up @@ -26,6 +26,18 @@

$capabilities = array(

'mod/chat:addinstance' => array(
'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),

'mod/chat:chat' => array(

'riskbitmask' => RISK_SPAM,
Expand Down Expand Up @@ -92,5 +104,3 @@
),

);


1 change: 1 addition & 0 deletions mod/chat/lang/en/chat.php
Expand Up @@ -47,6 +47,7 @@
$string['explainmethoddaemon'] = 'These settings matter <strong>only</strong> if you have selected "Chat server daemon" for chat_method';
$string['explainmethodnormal'] = 'These settings matter <strong>only</strong> if you have selected "Normal method" for chat_method';
$string['generalconfig'] = 'General configuration';
$string['chat:addinstance'] = 'Add a new chat';
$string['chat:deletelog'] = 'Delete chat logs';
$string['chat:exportparticipatedsession'] = 'Export chat session which you took part in';
$string['chat:exportsession'] = 'Export any chat session';
Expand Down
4 changes: 2 additions & 2 deletions mod/chat/version.php
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->version = 2012030700; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012030100.04; // Requires this Moodle version
$module->component = 'mod_chat'; // Full name of the plugin (used for diagnostics)
$module->cron = 300;
12 changes: 12 additions & 0 deletions mod/choice/db/access.php
Expand Up @@ -26,6 +26,18 @@

$capabilities = array(

'mod/choice:addinstance' => array(
'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),

'mod/choice:choose' => array(

'captype' => 'write',
Expand Down
1 change: 1 addition & 0 deletions mod/choice/lang/en/choice.php
Expand Up @@ -35,6 +35,7 @@
$string['full'] = '(Full)';
$string['havetologin'] = 'You have to log in before you can submit your choice';
$string['choice'] = 'Choice';
$string['choice:addinstance'] = 'Add a new choice';
$string['choiceclose'] = 'Until';
$string['choice:deleteresponses'] = 'Delete responses';
$string['choice:downloadresponses'] = 'Download responses';
Expand Down
4 changes: 2 additions & 2 deletions mod/choice/version.php
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->version = 2012030700; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012030100.04; // Requires this Moodle version
$module->component = 'mod_choice'; // Full name of the plugin (used for diagnostics)
$module->cron = 0;
12 changes: 12 additions & 0 deletions mod/data/db/access.php
Expand Up @@ -26,6 +26,18 @@

$capabilities = array(

'mod/data:addinstance' => array(
'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),

'mod/data:viewentry' => array(

'captype' => 'read',
Expand Down
1 change: 1 addition & 0 deletions mod/data/lang/en/data.php
Expand Up @@ -72,6 +72,7 @@
$string['csvimport'] = 'CSV file import';
$string['csvimport_help'] = 'Entries may be imported via a plain text file with a list of field names as the first line, then the data, with one record per line.';
$string['csvwithselecteddelimiter'] = '<acronym title="Comma Separated Values">CSV</acronym> text with selected delimiter:';
$string['data:addinstance'] = 'Add a new database';
$string['data:approve'] = 'Approve unapproved entries';
$string['data:comment'] = 'Write comments';
$string['data:exportallentries'] = 'Export all database entries';
Expand Down
4 changes: 2 additions & 2 deletions mod/data/version.php
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->version = 2012030700; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012030100.04; // Requires this Moodle version
$module->component = 'mod_data'; // Full name of the plugin (used for diagnostics)
$module->cron = 60;
12 changes: 12 additions & 0 deletions mod/feedback/db/access.php
Expand Up @@ -26,6 +26,18 @@

$capabilities = array(

'mod/feedback:addinstance' => array(
'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),

'mod/feedback:view' => array(

'captype' => 'read',
Expand Down
1 change: 1 addition & 0 deletions mod/feedback/lang/en/feedback.php
Expand Up @@ -106,6 +106,7 @@
$string['entries_saved'] = 'Your answers have been saved. Thank you.';
$string['export_questions'] = 'Export questions';
$string['export_to_excel'] = 'Export to Excel';
$string['feedback:addinstance'] = 'Add a new feedback';
$string['feedbackclose'] = 'Close the feedback at';
$string['feedbackcloses'] = 'Feedback closes';
$string['feedback:complete'] = 'Complete a feedback';
Expand Down
4 changes: 2 additions & 2 deletions mod/feedback/version.php
Expand Up @@ -25,8 +25,8 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->version = 2012030700; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012030100.04; // Requires this Moodle version
$module->component = 'mod_feedback'; // Full name of the plugin (used for diagnostics)
$module->cron = 0;

Expand Down
13 changes: 13 additions & 0 deletions mod/folder/db/access.php
Expand Up @@ -25,6 +25,19 @@
defined('MOODLE_INTERNAL') || die();

$capabilities = array(

'mod/folder:addinstance' => array(
'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),

'mod/folder:view' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
Expand Down
1 change: 1 addition & 0 deletions mod/folder/lang/en/folder.php
Expand Up @@ -25,6 +25,7 @@
*/

$string['contentheader'] = 'Content';
$string['folder:addinstance'] = 'Add a new folder';
$string['folder:managefiles'] = 'Manage files in folder module';
$string['folder:view'] = 'View folder content';
$string['foldercontent'] = 'Files and subfolders';
Expand Down
4 changes: 2 additions & 2 deletions mod/folder/version.php
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->version = 2012030700; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012030100.04; // Requires this Moodle version
$module->component = 'mod_folder'; // Full name of the plugin (used for diagnostics)
$module->cron = 0;
12 changes: 12 additions & 0 deletions mod/forum/db/access.php
Expand Up @@ -26,6 +26,18 @@

$capabilities = array(

'mod/forum:addinstance' => array(
'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),

'mod/forum:viewdiscussion' => array(

'captype' => 'read',
Expand Down
1 change: 1 addition & 0 deletions mod/forum/lang/en/forum.php
Expand Up @@ -149,6 +149,7 @@
$string['exportdiscussion'] = 'Export whole discussion';
$string['forcessubscribe'] = 'This forum forces everyone to be subscribed';
$string['forum'] = 'Forum';
$string['forum:addinstance'] = 'Add a new forum';
$string['forum:addnews'] = 'Add news';
$string['forum:addquestion'] = 'Add question';
$string['forumauthorhidden'] = 'Author (hidden)';
Expand Down
4 changes: 2 additions & 2 deletions mod/forum/version.php
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->version = 2012030700; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012030100.04; // Requires this Moodle version
$module->component = 'mod_forum'; // Full name of the plugin (used for diagnostics)
$module->cron = 60;
12 changes: 12 additions & 0 deletions mod/glossary/db/access.php
Expand Up @@ -26,6 +26,18 @@

$capabilities = array(

'mod/glossary:addinstance' => array(
'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),

'mod/glossary:write' => array(

'riskbitmask' => RISK_SPAM,
Expand Down
1 change: 1 addition & 0 deletions mod/glossary/lang/en/glossary.php
Expand Up @@ -170,6 +170,7 @@
$string['filtername'] = 'Glossary auto-linking';
$string['fullmatch'] = 'Match whole words only';
$string['fullmatch_help'] = 'This setting specifies whether only whole words will be linked, for example, a glossary entry named "construct" will not create a link inside the word "constructivism".';
$string['glossary:addinstance'] = 'Add a new glossary';
$string['glossary:approve'] = 'Approve unapproved entries';
$string['glossary:comment'] = 'Create comments';
$string['glossary:export'] = 'Export entries';
Expand Down
4 changes: 2 additions & 2 deletions mod/glossary/version.php
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2012022000; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->version = 2012030700; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012030100.04; // Requires this Moodle version
$module->component = 'mod_glossary'; // Full name of the plugin (used for diagnostics)
$module->cron = 0;
12 changes: 12 additions & 0 deletions mod/imscp/db/access.php
Expand Up @@ -34,6 +34,18 @@
)
),

'mod/imscp:addinstance' => array(
'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),

/* TODO: review public portfolio API first!
'mod/imscp:portfolioexport' => array(
Expand Down
1 change: 1 addition & 0 deletions mod/imscp/lang/en/imscp.php
Expand Up @@ -30,6 +30,7 @@
$string['deploymenterror'] = 'Content package error!';
$string['keepold'] = 'Archive packages';
$string['keepoldexplain'] = 'How many packages should be archived?';
$string['imscp:addinstance'] = 'Add a new IMS content package';
$string['imscp:view'] = 'View IMS content';
$string['modulename'] = 'IMS content package';
$string['modulename_help'] = 'An IMS content package allows for packages created according to the IMS Content Packaging specification to be displayed in the course.';
Expand Down
4 changes: 2 additions & 2 deletions mod/imscp/version.php
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->version = 2012030700; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2012030100.04; // Requires this Moodle version
$module->component = 'mod_imscp'; // Full name of the plugin (used for diagnostics)
$module->cron = 0;
41 changes: 41 additions & 0 deletions mod/label/db/access.php
@@ -0,0 +1,41 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

/**
* Capability definitions for the label module.
*
* @package mod_label
* @copyright 2012 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or late
*/

defined('MOODLE_INTERNAL') || die();

$capabilities = array(

'mod/label:addinstance' => array(
'riskbitmask' => RISK_XSS,

'captype' => 'write',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/course:manageactivities'
),

);
1 change: 1 addition & 0 deletions mod/label/lang/en/label.php
Expand Up @@ -24,6 +24,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$string['label:addinstance'] = 'Add a new label';
$string['labeltext'] = 'Label text';
$string['modulename'] = 'Label';
$string['modulename_help'] = 'A label enables text and images to be inserted among the activity links on the course page.';
Expand Down

0 comments on commit 88eca3c

Please sign in to comment.