Report for Site Admin only?

Report for Site Admin only?

by Luis de Vasconcelos -
Number of replies: 4

Is there a way to create a Configurable Report that is only accessible to Moodle Site Administrators?

Average of ratings: -
In reply to Luis de Vasconcelos

Re: Report for Site Admin only?

by Luis de Vasconcelos -

Example of what I want to achieve:
I've added the Configurable Reports block to my Moodle Site Home page. I then created a 'custom profile field' report that is not course specific, e.g.:

SELECT prefix_user.username, prefix_user.firstname, prefix_user.lastname, prefix_user_info_data.data AS profile_field_test
FROM prefix_user
INNER JOIN prefix_user_info_data ON prefix_user.id = prefix_user_info_data.userid
WHERE prefix_user_info_data.fieldid = 123
AND prefix_user_info_data.data LIKE N'xyz'

I only want Site Administrators to be able to access and run this report - non-admin users should not have access to it. Creating the report is simple, but how do I do restrict it to Site Administrators only?

Thanks.

In reply to Luis de Vasconcelos

Re: Report for Site Admin only?

by Michael E -
Picture of Core developers Picture of Testers

When you are in the report, click on the "Permissions" tab. You can specify a role which can see the report.

Alternatively, you can also specify "User field value" and enter the user ID (or last name etc.) of the user who is able to see the report.

Average of ratings: Useful (1)
In reply to Michael E

Re: Report for Site Admin only?

by Luis de Vasconcelos -

Thanks Michael. Yes, I'm using that now. But it restricts me to just one user. I'd like to give two or three admin users access to the report, so that solution isn't ideal. Alternatively, I could create the same report for each of the admin users, but that's a really ugly "solution".

In reply to Luis de Vasconcelos

Re: Report for Site Admin only?

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers

Just create a new role that has access to configurable reports block and then add your users to that...

Average of ratings: Useful (1)