I was intrigued enough to download the plugin and install it. After downloading and unzipping, I had a folder called customsql; but, it was not obvious where to install or copy the folder.
Where the heck do I put this newly downloaded / unzipped folder of joy?
The first place I tried to copy the files to was \admin. I reloaded the site but did NOT see the plugin check screen. I found the version.php file in the top level root, as is usually the case in plugins, updated the version #, saved the file, reloaded the page, but still no plugin check.I moved the folder from \admin to report\ and refreshed the page again. The plugin check screen appeared this time. The plugin installed with no issue. Logged in as admin, I went to the Admin|Reports menu and saw my new plugin selection.
There it is, Ad-hoc database queries. This is an interesting idea. Its like giving a window into the database. Its a little like giving someone access to the DB via a pro style tool like MySQL Workbench or phpMyAdmin. Its a little dangerous, since you are opening a big hole into the back end of your moodle site. Back end = DB. The author does provide an option in the interface to restrict who can see this option in the Reports menu. The next thing I did, was login to the site as one of my managers, the people who might actually use this report, and I could NOT see the menu option.
Remember, moodle uses a access.php file in the \pluginame\db path to determine who can see it. This is what the capabilities array said prior to me touching it.
// People who can view the reports at all.
'report/customsql:view' => array(
'riskbitmask' => RISK_PERSONAL,
'captype' => 'read',
'contextlevel' => CONTEXT_SYSTEM,
'legacy' => array(
)
)
I had a lot of frustration yesterday trying to set up permission for a native moodle role, manager. I like this plugin and need to be able to apply permissions to control who can see it. I'm talking about who can see the option in their reports menu. I went through this process at least 10 times yesterday.
- make an update to the $capabilities array defined in the db\access.php file
- change the version # in the version.php file
- reload the site page - notifications link
- click update the plugin
- switch to my other browser, where i am logged in as a user who is a manager
- refresh the browser page
- Click on Reports in the Admin. menu, and .....nothing
Site Admin | Users | Permissions | Capability overview
This is the Capability overview report, which is useful. You can see the capability rule highlighted. This is the rule that the plugin added
This is the Check system permissions report. I first selected the user, then the rule and got this report.
These are good tools for exactly this type of problem. Now if I could only get the permission for the above mentioned user - capability in the role of manager to say Yes.
No comments:
Post a Comment