What needs to be in the array in the applicable_formats()
function so it only is available on the My home
page of the user? I've set my-index
to true.
acces.php
<?php
$capabilities = array(
'block/groups:myaddinstance' => array(
'captype' => 'write',
'contextlevel' => CONTEXT_SYSTEM,
'archetypes' => array(
'user' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/my:manageblocks'
),
'block/groups:addinstance' => array(
'riskbitmask' => RISK_SPAM | RISK_XSS,
'captype' => 'write',
'contextlevel' => CONTEXT_BLOCK,
'archetypes' => array(
'editingteacher' => CAP_ALLOW,
'manager' => CAP_ALLOW
),
'clonepermissionsfrom' => 'moodle/site:manageblocks'
),
);
I've copied access.php from the blocks tutorial and only changed the names
UPDATE - it should be just 'my' rather than 'my-index'.
Also just for completeness, you might want to add all = false