]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4343 a user that can write to group can create subpages (sem's pull request...
authorCash Costello <cash.costello@gmail.com>
Sat, 16 Jun 2012 02:09:41 +0000 (22:09 -0400)
committerCash Costello <cash.costello@gmail.com>
Sat, 16 Jun 2012 02:09:41 +0000 (22:09 -0400)
mod/pages/pages/pages/view.php

index 81477a8d46889e1c504cac4d3b91e590e02ee5cf..9bfd67a1236916ceff6f534649e19d93dd5cce20 100644 (file)
@@ -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',