Moodle development traffic 09/2010
Latest stable version 1.9.7+
There were 12 commits into MOODLE_19_STABLE last week. Penny Leach added support for local events and running event queue in cron (MDL-17442). Eloy Lafuente committed a calendar patch prepared by Daniel Neis (MDL-17510) and another one by Darko Miletic from UVCMS, our Moodle Partner. Helen Foster fixed two help files, reported by Bente Olsen (MDL-21053, MDL-21054). Petr “frankenstein” Skoda fixed several input validation bugs, credit goes to Sascha Herzog for spotting them.
Unstable development version 2.0dev
There were 28 commits into the main development branch. Besides merges from the stable branch, various work in the Gradebook, Lesson module, themes, YUI, formslib, Quiz module and other areas of the code has been done.
Quotes of the week
“I never liked the frankenstyle plugin-naming scheme (coursereport_outline) … it started as an ugly hack to get around our own limitations in capability names and then took off like a virus all over the code.”
– Martin Dougiamas
“Arrrgh, the $PAGE magic is driving me crazy!”
– Petr Skoda
New algorithm of permission evaluation
On Sunday, Petr Skoda committed first parts of his recent work on the new permission evaluation, roles and enrolments changes for Moodle 2.0. The patch is quite big, affects 26 core files, inserts 1765 new lines and removes 2075 current lines of code. Compared with the current approach, the new way of calculating the effective user rights is significantly modified. In vast majority of cases, if role permissions and their overrides are used in a sane way, the new algorithm is backwards compatible, though.
The concept of roles, capabilities, permissions and their overriding at various context levels is one of the most powerful aspects of Moodle. Capabilities allow to tweak the behaviour of activity modules to fit the current needs. However, it is not easy (or sometimes even possible) to explain how the whole machinery actually works. Although Tim Hunt has prepared an useful tool to visualise how the permission is evaluated in the given context for the given user, it may be a tricky job to make sure the module works as expected in all thinkable situations. To be fair, it must be said that usually these tricky situations are very theoretical ones. Anyway, in Moodle 2.0, every time a permission check is done – for example by has_capability() call – the following steps are proceed.
- Firstly, a list of all roles that have something to do with the given permission or its override is populated.
- Then each of these roles is evaluated separately to look up for the roles that gives the user the permission in the given context.
- If the user is assigned any of the roles that gives him/her the evaluated permission, he/she is able to perform the controlled action.
This new way is expected to fix several known problems where a teacher was not actually able to guess or influence the resulting permission. From the usability perspective, it allows to design teacher-friendly and intuitive user interface to override role permissions. From a developer’s point of view, it allows to integrate capability check into your own SQL statement which generally increases the performance. See MDL-21710 and MDL-21711 for more details of this.
Post scriptum
$ git traffic –help
`git traffic’ is aliased to `log –after=”last monday 00:00″ –until=”last sunday 23:59″ –format=”%Creset%h by %an %Cgreen%s”‘



March 8th, 2010 at 23:44
[New Post] Moodle development traffic 09/2010 – via @twitoaster http://blog.mudrak.name/2010/03/moodle-d...