Roles & capabilities inheritance model question

Re: Roles & capabilities inheritance model question

by Tim Hunt -
Number of replies: 0
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Ah good. Your profile says you are a developer, so perhaps I can explain it this way.

Think about boolean operations. If I tell you

overallpermissions = adminpermissions OR authoriseduserpermissions;

would you say that adminpermissions inherit from authorisedpermissions, or would you say that the overall permissions are a combination of adminpermissions and authoriseduserpermissions.

Now, the above is not the correct pseudo code, because Moodle permissions are more complex that that:

  1. the logic is 4-valued (allow, not set, prevent, prohibit) rather than binary.
  2. the rules for combing the the permissions from the different roles you have are more complex that something like OR.
  3. Moodle roles only apply in specific places. For example, a user may be a teacher in one particular course. When that user is inside that course, the Teacher role has to be added to the mix, outside that course, for that user, the teacher role is not considered.