From: Cash Costello Date: Sat, 16 Jun 2012 02:09:41 +0000 (-0400) Subject: Fixes #4343 a user that can write to group can create subpages (sem's pull request... X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=3945ddea5f7b5bef5b5b67f8406ab9bbd5514955;p=lorea%2Felgg.git Fixes #4343 a user that can write to group can create subpages (sem's pull request plus comment) --- diff --git a/mod/pages/pages/pages/view.php b/mod/pages/pages/pages/view.php index 81477a8d4..9bfd67a12 100644 --- a/mod/pages/pages/pages/view.php +++ b/mod/pages/pages/pages/view.php @@ -32,7 +32,8 @@ elgg_push_breadcrumb($title); $content = elgg_view_entity($page, array('full_view' => true)); $content .= elgg_view_comments($page); -if (elgg_is_admin_logged_in() || elgg_get_logged_in_user_guid() == $page->getOwnerGuid()) { +// can add subpage if can edit this page and write to container (such as a group) +if ($page->canEdit() && $container->canWriteToContainer(0, 'object', 'page')) { $url = "pages/add/$page->guid"; elgg_register_menu_item('title', array( 'name' => 'subpage',