aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2012-06-15 22:09:41 -0400
committerCash Costello <cash.costello@gmail.com>2012-06-15 22:09:41 -0400
commit3945ddea5f7b5bef5b5b67f8406ab9bbd5514955 (patch)
treea584b6f83346f40eeaee6b5fd9fd7522dd64d596
parent19e2a8d99b0aab82e8213d171547486500b0784f (diff)
downloadelgg-3945ddea5f7b5bef5b5b67f8406ab9bbd5514955.tar.gz
elgg-3945ddea5f7b5bef5b5b67f8406ab9bbd5514955.tar.bz2
Fixes #4343 a user that can write to group can create subpages (sem's pull request plus comment)
-rw-r--r--mod/pages/pages/pages/view.php3
1 files changed, 2 insertions, 1 deletions
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',