MDL-36620 - Blog, RSS - Preventing Guests from viewing the RSS of site level blogs

This commit is contained in:
Jason Fowler 2012-11-22 15:44:27 +08:00 committed by Dan Poltawski
parent 7a216229ab
commit 21c3b51e27

View File

@ -163,6 +163,13 @@ function blog_rss_get_feed($context, $args) {
return '';
}
if ($CFG->bloglevel == BLOG_SITE_LEVEL) {
if (isguestuser()) {
debugging(get_string('nopermissiontoshow','error'));
return '';
}
}
$sitecontext = context_system::instance();
if (!has_capability('moodle/blog:view', $sitecontext)) {
return null;