Removed 'mod/glossary:view' capability
This commit is contained in:
@@ -33,20 +33,6 @@
|
||||
|
||||
$mod_glossary_capabilities = array(
|
||||
|
||||
'mod/glossary:view' => array(
|
||||
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_MODULE,
|
||||
'legacy' => array(
|
||||
'guest' => CAP_ALLOW,
|
||||
'student' => CAP_ALLOW,
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'coursecreator' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
)
|
||||
),
|
||||
|
||||
'mod/glossary:write' => array(
|
||||
|
||||
'riskbitmask' => RISK_SPAM,
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('mod/glossary:view', $context);
|
||||
$manageentries = has_capability('mod/glossary:manageentries', $context);
|
||||
|
||||
if (! $glossary = get_record("glossary", "id", $cm->instance)) {
|
||||
|
||||
@@ -56,10 +56,7 @@
|
||||
$table->align = array ("LEFT", "CENTER");
|
||||
}
|
||||
|
||||
$can_subscribe = has_capability('mod/glossary:view', $context);
|
||||
|
||||
if ($show_rss = (($can_subscribe || $course->id == SITEID) &&
|
||||
isset($CFG->enablerssfeeds) && isset($CFG->glossary_enablerssfeeds) &&
|
||||
if ($show_rss = (isset($CFG->enablerssfeeds) && isset($CFG->glossary_enablerssfeeds) &&
|
||||
$CFG->enablerssfeeds && $CFG->glossary_enablerssfeeds)) {
|
||||
$table->head[] = $strrss;
|
||||
$table->align[] = "CENTER";
|
||||
@@ -68,12 +65,15 @@
|
||||
$currentsection = "";
|
||||
|
||||
foreach ($glossarys as $glossary) {
|
||||
if (!$glossary->visible) {
|
||||
//Show dimmed if the mod is hidden
|
||||
if (!$glossary->visible && has_capability('moodle/course:viewhiddenactivities', $context)) {
|
||||
// Show dimmed if the mod is hidden.
|
||||
$link = "<a class=\"dimmed\" href=\"view.php?id=$glossary->coursemodule\">".format_string($glossary->name,true)."</a>";
|
||||
} else {
|
||||
//Show normal if the mod is visible
|
||||
} else if ($glossary->visible) {
|
||||
// Show normal if the mod is visible.
|
||||
$link = "<a href=\"view.php?id=$glossary->coursemodule\">".format_string($glossary->name,true)."</a>";
|
||||
} else {
|
||||
// Don't show the glossary.
|
||||
continue;
|
||||
}
|
||||
$printsection = "";
|
||||
if ($glossary->section !== $currentsection) {
|
||||
@@ -125,4 +125,4 @@
|
||||
|
||||
print_footer($course);
|
||||
|
||||
?>
|
||||
?>
|
||||
@@ -315,4 +315,4 @@
|
||||
}
|
||||
}
|
||||
$allentries = get_records_sql("$sqlselect $sqlfrom $sqlwhere $sqlorderby $sqllimit");
|
||||
?>
|
||||
?>
|
||||
@@ -45,7 +45,6 @@
|
||||
}
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('mod/glossary:view', $context); // kill the page if user can't even read
|
||||
|
||||
if ($CFG->forcelogin) {
|
||||
require_login();
|
||||
@@ -443,4 +442,4 @@
|
||||
|
||||
print_footer($course);
|
||||
|
||||
?>
|
||||
?>
|
||||
Reference in New Issue
Block a user