My first thought was to modify the db\access.php file
After all, this is the way moodle developers add permissions to roles and capabilities when developing plugins. After repeating this process way to many times, I asked for help in the moodle forum mentioned above. Tim Hunt, the author said, "don't mess with that file, create or set the permissions to allow via the front end. The front end meaning via moodle administration block.Admin | User | Permission | Define Role - then edit the role and update the permissions that were added to the moodle environment when installing the plugin. The permission I was after, the one I was trying to add in the access.db file was report/customsql:view.
Where are the role permissions?
When I tried editing the manager role, or any role, the role details, permissions, were not appearing. I posted in three different forum in moodle looking for any suggestions. After a couple days and no takers, I started to look again and think about what was different in my environment in the past few days since adding the plugin. I checked the theme, changed it to another theme, nothing.Finally, I decided to try moving the newly installed report\customsql folder out of moodle. After moving the folder outside the moodle root and clicking on the Notifications link and again checking the role details, they appeared, all the system wide permissions appeared - we just see the one below because I filtered for it. I edited the manager role, scrolled down the list until I saw the report/customsql:view rule and updated the Allow bit.
Something in the plugin is causing the role permissions to not display.
I put the block back into the moodle root and clicked notifications, but the plugin screen did not appear. I had to increment the version.php file, as always, to trip the plugins screen to display. I reinstalled the plugin and logged in as one of the users defined in the manager role, checked the Admin menu and this is what I saw, Ad-hoc database queries - yeah!
Moral of the story?
Be wary of unintentional side effects of installing plugins.
I will also look at the CSS and let Tim Hunt know what happened here, since I still can't edit role permissions with this plugin in place. If I need to edit a permission of a role again, I will have to move the plugin outside moodle again.
No comments:
Post a Comment