Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion classes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class block_quickmail_plugin {
* @throws required_capability_exception
*/
public static function require_user_can_send($sendtype, $user, $context, $page) {
if (!self::user_can_send($sendtype, $user, $context, $page, false)) {
$includestudentaccess = -1 !== (int) get_config('moodle', 'block_quickmail_allowstudents');
if (!self::user_can_send($sendtype, $user, $context, $page, $includestudentaccess)) {
$capability = $sendtype == 'broadcast' ? 'myaddinstance' : 'cansend';

throw new required_capability_exception($context, 'block/quickmail:' . $capability, 'nopermissions', '');
Expand Down