1) I went into the file called: mymoodleroot/blocks/settings/block_settings.php
2) Inside two functions, I simply placed a role check at the beginning:
function get_content()
{
// only shows the settings block to admins
global $USER, $CFG, $DB;
if(!is_siteadmin($USER)) {return;}
...
}
function init()
{
global $USER, $CFG, $DB;
if(!is_siteadmin($USER)) {return;}
...
}
I'm sure that code could be modified to display to different roles and possibilities. This is just a simple example and it works!
No comments:
Post a Comment