Permalink
Browse files

Revert "MDL-30482 create new capability for viewing glossary entries"…

… (test failed)

This reverts commit 03adb28.
  • Loading branch information...
1 parent ba0c76e commit cb8e878573d7c911018a4b4d87da4fa42206b203 @nebgor nebgor committed Dec 15, 2011
Showing with 2 additions and 17 deletions.
  1. +0 −14 mod/glossary/db/access.php
  2. +0 −1 mod/glossary/lang/en/glossary.php
  3. +2 −1 mod/glossary/rsslib.php
  4. +0 −1 mod/glossary/view.php
View
14 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,
View
1 mod/glossary/lang/en/glossary.php
@@ -178,7 +178,6 @@
$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';
View
3 mod/glossary/rsslib.php
@@ -23,7 +23,8 @@ function glossary_rss_get_feed($context, $args) {
$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;
}
}
View
1 mod/glossary/view.php
@@ -49,7 +49,6 @@
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(

0 comments on commit cb8e878

Please sign in to comment.