Moodle

multiple overrides in same role assignment not respected

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Blocker Blocker
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9
  • Component/s: Roles / Access
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

I have this setup

1 user assigned a teacher role at system level (global role)
In course category, teacher role has an override for addnews set to allow
In child course, teacher role has an override for addnews set to prevent
Teacher has no assignment in child course

Go into course as teacher, teacher is able to addnews.

Under old system, the first override at course cat level is 1040, and the override at the course level is 1050 which should take precedence.

Activity

Hide
Martín Langhoff added a comment -

The problem lies with the lookup of role definitions in get_user_access_bycontext() which is subtly buggy in that it doesn't realise that it has to read in the override at the course level. I have an initial working patch but won't be able to finish it off today.

Show
Martín Langhoff added a comment - The problem lies with the lookup of role definitions in get_user_access_bycontext() which is subtly buggy in that it doesn't realise that it has to read in the override at the course level. I have an initial working patch but won't be able to finish it off today.
Hide
Martín Langhoff added a comment - - edited

Fixed in mdl19-perf - cleaning up the fix took me a bit of time!
http://git.catalyst.net.nz/gitweb?p=moodle-r2.git;a=commitdiff;h=51fe4f046e470ced522b30b1559aff9fb63b0420

(Edit - changed the code a bit - the new commit is the right one...)

Show
Martín Langhoff added a comment - - edited Fixed in mdl19-perf - cleaning up the fix took me a bit of time! http://git.catalyst.net.nz/gitweb?p=moodle-r2.git;a=commitdiff;h=51fe4f046e470ced522b30b1559aff9fb63b0420 (Edit - changed the code a bit - the new commit is the right one...)
Hide
Martín Langhoff added a comment -

Also fixed a related problem with overrides at the category level.

Show
Martín Langhoff added a comment - Also fixed a related problem with overrides at the category level.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: