New report development help

New report development help

by Kutasi Beata -
Number of replies: 0

Hi,

I've been trying to develop a report based on the moodles log table(I'm using Moodle 2.6), following carefully the developers guide, but couldn't get too far. Got stuck at the capabilities section. I have an access.php file in report/myreport/db folder, which contains the following:

$capablities = array(
   'report/myreport:view' => array(
        'captype' => 'read',
        'riskbitmask' => RISK_PERSONAL,
        'contextlevel' => CONTEXT_SYSTEM,
        'archetypes' => array(
            'guest' => CAP_PREVENT,
            'student' => CAP_PREVENT,
            'teacher' => CAP_ALLOW,
            'editingteacher' => CAP_ALLOW,
            'coursecreator' => CAP_ALLOW,
            'manager' => CAP_ALLOW
       )
    ),
    'report/myreport:edit' => array(
        'captype' => 'write',
        'riskbitmask' => RISK_PERSONAL | RISK_SPAM | RISK_XSS,
        'contextlevel' => CONTEXT_SYSTEM,
        'archetypes' => array(
        'guest' => CAP_PREVENT,
        'student' => CAP_PREVENT,
        'teacher' => CAP_PREVENT,
        'editingteacher' => CAP_ALLOW,
        'coursecreator' => CAP_ALLOW,
        'manager' => CAP_ALLOW
    )
);

The problem is that after bumping the version number of the report and updating the database I could not find the capability in the mdl_capabilities table. What did I miss? Or is this a bug?

Average of ratings: -