MDL-50666 core: Add function get_viewable_roles to set role visibility

This commit is contained in:
Andrew Hancox
2017-12-19 13:53:23 +13:00
committed by Jun Pataleta
parent 95b7be7f05
commit a63cd3e2ca
32 changed files with 685 additions and 37 deletions
+2 -2
View File
@@ -789,9 +789,9 @@ EOD;
if ($record['archetype']) {
// We copy all the roles the archetype can assign, override and switch to.
// We copy all the roles the archetype can assign, override, switch to and view.
if ($record['archetype']) {
$types = array('assign', 'override', 'switch');
$types = array('assign', 'override', 'switch', 'view');
foreach ($types as $type) {
$rolestocopy = get_default_role_archetype_allows($type, $record['archetype']);
foreach ($rolestocopy as $tocopy) {