Hi people,
I'm currently adding a new capability to Moodle but I cannot get it to assign the capability on a clean install.
I have put the following into lib/db/access.php
'moodle/my:manageblocks' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM
)
This adds the capability into the <prefix>_capability table, but I cannot find the correct place to put the assign_capability() call for clean installation, although I have got it working for upgrade - I put the following into lib/db/upgrade.php
[code]
if ($result && $oldversion < [VERSONDATE]) {
// Add in the new moodle/my:manageblocks capibility to the default user role
$context = get_context_instance(CONTEXT_SYSTEM, SITEID); assign_capability('moodle/my:manageblocks', CAP_ALLOW, $CFG->defaultuserroleid, $context->id);
}
[/code]
I'm assuming there is a similar place to put this for clean install, but I cannot find it.
Could someone please point me in the right direction?