From: vyshane Date: Fri, 22 Sep 2006 02:52:48 +0000 (+0000) Subject: Removed 'mod/glossary:view' capability X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7949f21b5fce2ddbdff8523aa853a4f283ebdbfe;p=moodle.git Removed 'mod/glossary:view' capability --- diff --git a/mod/glossary/db/access.php b/mod/glossary/db/access.php index 32572f8b1c..6a3254cae7 100644 --- a/mod/glossary/db/access.php +++ b/mod/glossary/db/access.php @@ -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, diff --git a/mod/glossary/deleteentry.php b/mod/glossary/deleteentry.php index 3058025e68..a9bf26b444 100644 --- a/mod/glossary/deleteentry.php +++ b/mod/glossary/deleteentry.php @@ -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)) { diff --git a/mod/glossary/index.php b/mod/glossary/index.php index 9c2477ade6..a6758df813 100644 --- a/mod/glossary/index.php +++ b/mod/glossary/index.php @@ -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 = "coursemodule\">".format_string($glossary->name,true).""; - } else { - //Show normal if the mod is visible + } else if ($glossary->visible) { + // Show normal if the mod is visible. $link = "coursemodule\">".format_string($glossary->name,true).""; + } else { + // Don't show the glossary. + continue; } $printsection = ""; if ($glossary->section !== $currentsection) { @@ -125,4 +125,4 @@ print_footer($course); -?> +?> \ No newline at end of file diff --git a/mod/glossary/sql.php b/mod/glossary/sql.php index baf54ac983..c2ba24e93e 100644 --- a/mod/glossary/sql.php +++ b/mod/glossary/sql.php @@ -315,4 +315,4 @@ } } $allentries = get_records_sql("$sqlselect $sqlfrom $sqlwhere $sqlorderby $sqllimit"); -?> +?> \ No newline at end of file diff --git a/mod/glossary/view.php b/mod/glossary/view.php index 98a2f2f6ba..76e60e4c95 100644 --- a/mod/glossary/view.php +++ b/mod/glossary/view.php @@ -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); -?> +?> \ No newline at end of file