From 3f791403b3b74b38bef22e0310e10a1421516d6b Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Fri, 23 Apr 2010 09:05:56 +0000 Subject: [PATCH] MDL-21781 cohort capabilities --- lib/db/access.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/lib/db/access.php b/lib/db/access.php index a79ccfbdbd4..8885aeaaeb3 100644 --- a/lib/db/access.php +++ b/lib/db/access.php @@ -470,6 +470,39 @@ $capabilities = array( 'clonepermissionsfrom' => 'moodle/category:visibility' ), + // create, delete, move cohorts in system and course categories, + // (cohorts with component !== null can be only moved) + 'moodle/cohort:manage' => array( + + 'captype' => 'write', + 'contextlevel' => CONTEXT_COURSECAT, + 'legacy' => array( + 'manager' => CAP_ALLOW + ) + ), + + // add and remove cohort members (only for cohorts where component !== null) + 'moodle/cohort:assign' => array( + + 'captype' => 'write', + 'contextlevel' => CONTEXT_COURSECAT, + 'legacy' => array( + 'manager' => CAP_ALLOW + ) + ), + + // view members of a cohort, this can be used in course context too, + // this also controls the ability to actually use cohort + 'moodle/cohort:view' => array( + + 'captype' => 'read', + 'contextlevel' => CONTEXT_COURSE, + 'legacy' => array( + 'editingteacher' => CAP_ALLOW, + 'manager' => CAP_ALLOW + ) + ), + 'moodle/course:create' => array( 'riskbitmask' => RISK_XSS, -- 2.43.0