report view

report view

od Alpesh Mistry -
Število odgovorov: 6
hi
i am trying to make one report.
but i saw that my report is only accessible by admin not bye other user.
to make it access from others what i have to do?
Povprečje ocenitev: -
V odgovor na Alpesh Mistry

Re: report view

od Tim Hunt -
Slika Core developers Slika Documentation writers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin developers
What report where? What have you tried so far?
V odgovor na Tim Hunt

Re: report view

od Alpesh Mistry -
i am trying to make simple report.
at first i use same code as in overview report at "/grade/report/overview" .
i had just replace overview word by my report .
is there any changes to make any where other then its module.
V odgovor na Alpesh Mistry

Re: report view

od Tim Hunt -
Slika Core developers Slika Documentation writers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin developers
Have you been to the admin notifications page to let your new plugin install iteslf? (In this case, it probably needs to set up the new capability and assign it to the teacher role.)
V odgovor na Tim Hunt

Re: report view

od Alpesh Mistry -
sorry
but i can't.
i think this some capability problem.
i see that has_capability() function return false at moodle/grade/report/index.php at lineno:39 when "$plugin" variable value is "mynewreport".
i can't understand what is it.
thanks in advance.
V odgovor na Alpesh Mistry

Re: report view

od Tim Hunt -
Slika Core developers Slika Documentation writers Slika Particularly helpful Moodlers Slika Peer reviewers Slika Plugin developers
In your plugin's grade/report/mynewreport/db/access.php, do you define a gradereport/mynewreport:view capability (like in http://cvs.moodle.org/moodle/grade/report/overview/db/access.php?view=markup&pathrev=MOODLE_19_STABLE).

If yes, then next thing to check is that after you have installed your plugin, the capability is saved in the database in the capability table, and is associated with the right role in the role_capabilities table.

First you need to check all that. If all that is OK, then we will have to dig deeper.
V odgovor na Tim Hunt

Re: report view

od Alpesh Mistry -
thank you for replay
i had check it its access.php is wright
but
there is no record in role_capabilities table of report.

my /gade/report/mynewreport/db/access.php is

<?php
$gradereport_mynewreport_capabilities = array(
'gradereport/mynewreport:view' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'legacy' => array(
'student' => CAP_ALLOW,
'teacher' => CAP_ALLOW,
'editingteacher' => CAP_ALLOW,
'admin' => CAP_ALLOW
)
)
);
?>

and role_capabilities table records are as follow:

query that i use.

mysql> select id,roleid,capability from mdl_role_capabilities where capability like 'graderep%';

result of query is:

+-----+--------+---------------------------+
| id | roleid | capability |
+-----+--------+---------------------------+
| 520 | 4 | gradereport/grader:view |
| 521 | 3 | gradereport/grader:view |
| 522 | 1 | gradereport/grader:view |
| 523 | 4 | gradereport/outcomes:view |
| 524 | 3 | gradereport/outcomes:view |
| 525 | 1 | gradereport/outcomes:view |
| 526 | 4 | gradereport/overview:view |
| 527 | 3 | gradereport/overview:view |
| 528 | 5 | gradereport/overview:view |
| 529 | 1 | gradereport/overview:view |
| 530 | 5 | gradereport/user:view |
| 531 | 4 | gradereport/user:view |
| 532 | 3 | gradereport/user:view |
| 533 | 1 | gradereport/user:view |
+-----+--------+---------------------------+