]> git.mjollnir.org Git - moodle.git/commitdiff
Removed 'mod/glossary:view' capability
authorvyshane <vyshane>
Fri, 22 Sep 2006 02:52:48 +0000 (02:52 +0000)
committervyshane <vyshane>
Fri, 22 Sep 2006 02:52:48 +0000 (02:52 +0000)
mod/glossary/db/access.php
mod/glossary/deleteentry.php
mod/glossary/index.php
mod/glossary/sql.php
mod/glossary/view.php

index 32572f8b1ce258536f81b8beebbb5cfdfbb80175..6a3254cae78e679fdd2dfecd0bdbddd7aa0b57ec 100644 (file)
 
 $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,
index 3058025e688cda6052022f0a900bd7575afdafd5..a9bf26b4441199fd9e956f10ac0b1d24df3d83d1 100644 (file)
@@ -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)) {
index 9c2477ade663ea7a55bc6575d4b18e69024ab3f3..a6758df813d09235d3b8a3f901db317f7195f901 100644 (file)
         $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";
     $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) {
 
     print_footer($course);
 
-?>
+?>
\ No newline at end of file
index baf54ac9839e5381d9a172b5fc28f0773a6ff1c4..c2ba24e93eea55c5e2ecbff00f2604cbe6f3ba12 100644 (file)
         }    
     }
     $allentries = get_records_sql("$sqlselect $sqlfrom $sqlwhere $sqlorderby $sqllimit");
-?>
+?>
\ No newline at end of file
index 98a2f2f6ba1d0b6e619d8c8c9c230ccc3d38ef96..76e60e4c954c78ca71f9288b886295266eed1037 100644 (file)
@@ -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();
 
     print_footer($course);
 
-?>
+?>
\ No newline at end of file