From 346d082dae4da3908f7c7a6b8b9946768e19f5d6 Mon Sep 17 00:00:00 2001 From: cash Date: Sun, 20 Mar 2011 23:34:10 +0000 Subject: Fixes #2974 using canWriteToContainer() to control access to creating group content git-svn-id: http://code.elgg.org/elgg/trunk@8795 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/groups/actions/discussion/reply/save.php | 2 +- mod/groups/actions/discussion/save.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'mod/groups/actions/discussion') diff --git a/mod/groups/actions/discussion/reply/save.php b/mod/groups/actions/discussion/reply/save.php index e535856da..109938dbb 100644 --- a/mod/groups/actions/discussion/reply/save.php +++ b/mod/groups/actions/discussion/reply/save.php @@ -25,7 +25,7 @@ if (!$topic) { $user = get_loggedin_user(); $group = $topic->getContainerEntity(); -if (!$group->isMember($user)) { +if (!$group->canWriteToContainer($user)) { register_error(elgg_echo('groups:notmember')); forward(REFERER); } diff --git a/mod/groups/actions/discussion/save.php b/mod/groups/actions/discussion/save.php index 0b5d3b51c..a51775cd6 100644 --- a/mod/groups/actions/discussion/save.php +++ b/mod/groups/actions/discussion/save.php @@ -21,7 +21,7 @@ if (!$title || !$desc) { } $container = get_entity($container_guid); -if (!$container || (!$container->isMember() && !$container->canEdit())) { +if (!$container || !$container->canWriteToContainer()) { register_error(elgg_echo('discussion:error:permissions')); forward(REFERER); } -- cgit v1.2.3