Merge branch 'w26_MDL-40289_m26_badgescaps' of git://github.com/skodak/moodle

This commit is contained in:
Sam Hemelryk 2013-06-25 09:13:16 +12:00
commit cbc4b33afd
3 changed files with 20 additions and 30 deletions

View File

@ -26,11 +26,11 @@
$capabilities = array(
'block/badges:addinstance' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW,
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:manageblocks'
),

View File

@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2013050100; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2013050101; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2013050100; // Requires this Moodle version.
$plugin->component = 'block_badges';

View File

@ -1892,19 +1892,17 @@ $capabilities = array(
// View available badges without earning them.
'moodle/badges:viewbadges' => array(
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'user' => CAP_ALLOW,
'student' => CAP_ALLOW
)
),
// Manage badges on own private badges page.
'moodle/badges:manageownbadges' => array(
'riskbitmap' => RISK_SPAM | RISK_PERSONAL,
'riskbitmap' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_USER,
'archetypes' => array(
'user' => CAP_ALLOW
)
@ -1923,69 +1921,62 @@ $capabilities = array(
// Earn badge.
'moodle/badges:earnbadge' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'user' => CAP_ALLOW,
'student' => CAP_ALLOW,
)
),
// Create/duplicate badges.
'moodle/badges:createbadge' => array(
'riskbitmask' => RISK_CONFIG | RISK_SPAM,
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Delete badges.
'moodle/badges:deletebadge' => array(
'riskbitmask' => RISK_CONFIG | RISK_DATALOSS,
'riskbitmask' => RISK_DATALOSS,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Set up/edit badge details.
'moodle/badges:configuredetails' => array(
'riskbitmask' => RISK_CONFIG,
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Set up/edit criteria of earning a badge.
'moodle/badges:configurecriteria' => array(
'riskbitmask' => RISK_CONFIG,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
// Configure badge messages.
'moodle/badges:configuremessages' => array(
'riskbitmask' => RISK_CONFIG,
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
),
@ -1994,10 +1985,9 @@ $capabilities = array(
'moodle/badges:awardbadge' => array(
'riskbitmask' => RISK_SPAM,
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'coursecreator' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
)
@ -2007,7 +1997,7 @@ $capabilities = array(
'moodle/badges:viewawarded' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'manager' => CAP_ALLOW,
'teacher' => CAP_ALLOW,