About two weeks ago, a client raised an issue with their moodle installation. The client wanted course teachers to be able to take LAMS activites instead of just being allowed to author them. Then just this week, another client wanted to suppress the emails sent to course teachers when a student answers a quiz activity in moodle.
Both these issues are related in a way since the code logic that determines who can take a LAMS activity and the code for who are notified of quiz submissions both rely on checking moodle roles and capabilities. If you're familiar with moodle, then you'd be aware of the different roles that can be assigned to a user both on the site level and on the course level. What some people miss is that there are capabilities as well that's assigned to each of these roles. In order to resolve the issues that the clients raised without modifying the code, I needed to override these role capabilities so that they would behave as to how the client wants them to.
I'll outline here the steps of what you need to do to change the default roles capabilities in case you are faced with a similar problem.
To change the top-level role capabilities:
- Login as administrator.
- Locate your Site Administration block and click on these menu items -- "Users -> Permissions -> Define roles". You will be presented with a screen listing the different roles.

- Click on the role name whose permissions you want to change.
- You will now be presented with a screen displaying the role details as well as the permissions assigned to the role for the different capabilities.

- Click on "Edit" and adjust the setting for each capability as necessary. You can set each capability to one of four possible values:
- Not set - leave permission as is, inherit from parent context
- Allow - allow this capability for this role, apply this to children as well unless overriden in the child context
- Prevent - remove permission on this role for this context, can be overriden by a lower context
- Prohibit - same as Prevent but do not allow override by a lower context
- Click on "Save changes"
To change the course level capabilities:
- Login as user with administrator rights to a course.
- Visit the course page.
- Click on "Assign roles" under the "Administration" block.

- You will be presented a page where you can assign a role to users along with a tab labeled "Override permissions". Click on the "Override permissions" tab.
- You will now be presented with a screen displaying the role names.

- Click on the role name whose permissions you want to change.
- You will now be presented with a screen displaying permissions assigned to the role for the different capabilities.
- Adjust the setting for each capability as necessary. You can set each capability to one of four possible values:
- Inherit - inherit from parent context
- Allow - allow this capability for this role, apply this to children as well unless overriden in the child context
- Prevent - remove permission on this role for this context, can be overriden by a lower context
- Prohibit - same as Prevent but do not allow override by a lower context
- Click on "Save changes"
To change capabilities for a lower context (typically activities):
- Visit the course page using a user with proper rights.
- Click on "Turn editing on".
- Click on "Update" icon for the particular activity whose permissions you want to override.
- Click on "Override permissions" tab.
- You will now be presented with a screen displaying the role names.
- Click on the role name whose permissions you want to change.
- You will now be presented with a screen displaying permissions assigned to the role for the different capabilities.
- Adjust the setting for each capability as necessary. You can set each capability to one of four possible values:
- Inherit - inherit from parent context
- Allow - allow this capability for this role, apply this to children as well unless overriden in the child context
- Prevent - remove permission on this role for this context, can be overriden by a lower context
- Prohibit - same as Prevent but do not allow override by a lower context
- Click on "Save changes"