In the current version a user has to be admin to approve course requests, configure the templates and to see old course requests.
It would be better to make more use of the existing module privilges (rights) like block/cmanager:viewconfig or block/cmanager:approverecord without the need of the admin role.
See cmanager_admin.php
require_once('validate_admin.php'); /* not needed when checking and making use of the capabilities*/
require_once('../../course/lib.php');
require_once('lib/displayLists.php');
/** Navigation Bar **/
$PAGE->navbar->ignore_active();
$PAGE->navbar->add(get_string('cmanagerDisplay', 'block_cmanager'), new moodle_url('/blocks/cmanager/cmanager_admin.php'));
$PAGE->set_url('/blocks/cmanager/cmanager_admin.php');
$PAGE->set_context(context_system::instance());
$PAGE->set_heading(get_string('pluginname', 'block_cmanager'));
$PAGE->set_title(get_string('pluginname', 'block_cmanager'));
echo $OUTPUT->header();
$_SESSION['CRMisAdmin'] = true;
$context = context_system::instance();
if (has_capability('block/cmanager:viewconfig',$context)) {
} else {
print_error(get_string('cannotviewconfig', 'block_cmanager'));
}
If ok, I will refactor the code and provide a detailed documentation for the priviliges with my bad german english. ;)
In the current version a user has to be admin to approve course requests, configure the templates and to see old course requests.
It would be better to make more use of the existing module privilges (rights) like
block/cmanager:viewconfig
orblock/cmanager:approverecord
without the need of the admin role.See cmanager_admin.php
If ok, I will refactor the code and provide a detailed documentation for the priviliges with my bad german english. ;)