Specify 'Mentor' role in access.php

Specify 'Mentor' role in access.php

by Adrian Chan -
Number of replies: 0

I have setup an new role 'mentor' without legacy role. And I'm now developing a new block, but don't know how to define default capability in access.php since this role has no related legacy role.

$block_mentor_capabilities = array(

    'block/mentor:use' => array(

        'captype' => 'write',
        'contextlevel' => CONTEXT_BLOCK,
        'legacy' => array(
            'admin' => CAP_ALLOW,
            'student' => CAP_ALLOW,

            'mentor' => CAP_ALLOW    // ERROR
        )
    ),

);

 If I do so, Moodle will prompt no such role is found as pressing the 'Notification' link.

I have read below link but seems not so relevance.

http://dev.moodle.org/mod/page/view.php?id=52

Can anyone suggest how to do this setting in access.php?

Average of ratings: -