From 73c0d464160ed130cded72263597a9ef8cbd2217 Mon Sep 17 00:00:00 2001 From: Aparup Banerjee Date: Thu, 15 Dec 2011 15:49:55 +0800 Subject: [PATCH] Revert "MDL-30482 create new capability for viewing glossary entries" This reverts commit b92ac8c07989a7a7d8659169d465341e55a95d72. --- mod/glossary/db/access.php | 14 -------------- mod/glossary/lang/en/glossary.php | 1 - mod/glossary/rsslib.php | 3 ++- mod/glossary/view.php | 1 - 4 files changed, 2 insertions(+), 17 deletions(-) diff --git a/mod/glossary/db/access.php b/mod/glossary/db/access.php index 5d276c41151..13ca17081f4 100644 --- a/mod/glossary/db/access.php +++ b/mod/glossary/db/access.php @@ -30,20 +30,6 @@ $capabilities = array( - 'mod/glossary:read' => array( - - 'captype' => 'read', - 'contextlevel' => CONTEXT_MODULE, - 'archetypes' => array( - 'guest' => CAP_ALLOW, - 'student' => CAP_ALLOW, - 'teacher' => CAP_ALLOW, - 'editingteacher' => CAP_ALLOW, - 'manager' => CAP_ALLOW - ) - ), - - 'mod/glossary:write' => array( 'riskbitmask' => RISK_SPAM, diff --git a/mod/glossary/lang/en/glossary.php b/mod/glossary/lang/en/glossary.php index 4c4827c8b23..535f758dc77 100644 --- a/mod/glossary/lang/en/glossary.php +++ b/mod/glossary/lang/en/glossary.php @@ -178,7 +178,6 @@ $string['glossary:managecategories'] = 'Manage categories'; $string['glossary:managecomments'] = 'Manage comments'; $string['glossary:manageentries'] = 'Manage entries'; $string['glossary:rate'] = 'Rate entries'; -$string['glossary:read'] = 'Read entries'; $string['glossarytype'] = 'Glossary type'; $string['glossarytype_help'] = 'A main glossary is a glossary in which entries from secondary glossaries can be imported. There can only be one main glossary in a course. if glossary entry import is not required, all glossaries in the course can be secondary glossaries.'; $string['glossary:view'] = 'View glossary'; diff --git a/mod/glossary/rsslib.php b/mod/glossary/rsslib.php index bb84a6ddfcc..5134126f8aa 100644 --- a/mod/glossary/rsslib.php +++ b/mod/glossary/rsslib.php @@ -23,7 +23,8 @@ $course = $DB->get_record('course', array('id'=>$cm->course), '*', MUST_EXIST); } //context id from db should match the submitted one - if ($context->id != $modcontext->id || !has_capability('mod/glossary:read', $modcontext)) { + //no specific capability required to view glossary entries so just check user is enrolled + if ($context->id != $modcontext->id || !can_access_course($course, $USER)) { return null; } } diff --git a/mod/glossary/view.php b/mod/glossary/view.php index 420d6048ec7..fe16b5ec6ca 100644 --- a/mod/glossary/view.php +++ b/mod/glossary/view.php @@ -49,7 +49,6 @@ if (!empty($id)) { require_course_login($course->id, true, $cm); $context = get_context_instance(CONTEXT_MODULE, $cm->id); -require_capability('mod/glossary:read', $context); // Prepare format_string/text options $fmtoptions = array(