From 3945ddea5f7b5bef5b5b67f8406ab9bbd5514955 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Fri, 15 Jun 2012 22:09:41 -0400 Subject: Fixes #4343 a user that can write to group can create subpages (sem's pull request plus comment) --- mod/pages/pages/pages/view.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'mod/pages') 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', -- cgit v1.2.3