Report Generator - Access denied

hi all,
I just upgraded from 2.4.8 to version OJS 3.1.1-4. I can’t seem to get access to our “Generate custom report”. When I clicked on it, I got an error message " access denied" . Please see my attachement

Report-error

Can some one please let me know how to fix this issue?

many thanks
-Peter

1 Like

Hi @Ptran

Have you checked your browser console error log and your PHP server error log?
They may show you some helpful messages regarding this issue.

Best,
Israel

We’re experiencing this as well:

09%20AM

03%20AM

I turned PHP warnings back on, and can now see the following appearing multiple times:

[Wed Sep 19 09:37:14.807012 2018] [php7:warn] [pid 6323] [client] PHP Warning: Cannot assign an empty string to a string offset in /data/apache-html/windsor/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: https://wyaj.uwindsor.ca/index.php/wyaj/management/tools/reportGenerator

[Wed Sep 19 09:56:34.867127 2018] [php7:warn] [pid 9536] [] PHP Warning: Illegal string offset 'en_US' in /data/apache-html/windsor/lib/pkp/classes/core/DataObject.inc.php on line 133, referer: https://wyaj.uwindsor.ca/index.php/wyaj/management/tools/reportGenerator

So it seems like PKPHandler::authorize() needs to be called in ReportGeneratorHandler.inc.php. Adding the following made it work:

	function authorize($request, &$args, $roleAssignments) {
		import('lib.pkp.classes.security.authorization.ContextAccessPolicy');
		$this->addPolicy(new ContextAccessPolicy($request, $roleAssignments));
		return parent::authorize($request, $args, $roleAssignments);
	}
2 Likes

Hi all,

The issue has also been filed here: Access denied when trying to access some editorial/JM functions · Issue #4074 · pkp/pkp-lib · GitHub

(@bart, thanks for the proposal – that’s the correct solution and I’ve committed it over on the Git issue!)

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you, Bart!

I’ve added it at the end of my ReportGeneratorHandler.inc.php and now can generate reports!

Thank you very much.

Correction helped me a lot.

:100: :100: