mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
MDL-37633 Forum: Allow fronpage user to have forum:allowforcesubscribe capability by default
This commit is contained in:
parent
6319737865
commit
afd5e85ca8
4 changed files with 21 additions and 3 deletions
|
@ -341,7 +341,8 @@ $capabilities = array(
|
|||
'archetypes' => array(
|
||||
'student' => CAP_ALLOW,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'frontpage' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
);
|
||||
|
|
|
@ -57,7 +57,16 @@ function xmldb_forum_upgrade($oldversion) {
|
|||
// Moodle v2.4.0 release upgrade line
|
||||
// Put any upgrade step following this
|
||||
|
||||
|
||||
// Forcefully assign mod/forum:allowforcesubscribe to frontpage role, as we missed that when
|
||||
// capability was introduced.
|
||||
if ($oldversion < 2013020500) {
|
||||
// If capability mod/forum:allowforcesubscribe is defined then set it for frontpage role.
|
||||
if (get_capability_info('mod/forum:allowforcesubscribe')) {
|
||||
assign_legacy_capabilities('mod/forum:allowforcesubscribe', array('frontpage' => CAP_ALLOW));
|
||||
}
|
||||
// Forum savepoint reached.
|
||||
upgrade_mod_savepoint(true, 2013020500, 'forum');
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue