Revert "MDL-30482 create new capability for viewing glossary entries"
This reverts commit b92ac8c079.
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user