report view

report view

Alpesh Mistry írta időpontban
Válaszok szám: 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?
Értékelések átlaga: -
Válasz erre: Alpesh Mistry

Re: report view

Tim Hunt írta időpontban
Kép Kép Kép Kép Kép
What report where? What have you tried so far?
Válasz erre: Tim Hunt

Re: report view

Alpesh Mistry írta időpontban
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álasz erre: Alpesh Mistry

Re: report view

Tim Hunt írta időpontban
Kép Kép Kép Kép Kép
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álasz erre: Tim Hunt

Re: report view

Alpesh Mistry írta időpontban
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álasz erre: Alpesh Mistry

Re: report view

Tim Hunt írta időpontban
Kép Kép Kép Kép Kép
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álasz erre: Tim Hunt

Re: report view

Alpesh Mistry írta időpontban
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 |
+-----+--------+---------------------------+