From 1091616705ffce9c90d7a692eb81616edf383d3c Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 3 Feb 2009 00:11:52 +0000 Subject: [PATCH] Prevent WikiPages from being manually added to places where they shouldn't. --- lib/WebGUI/Asset/WikiPage.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/WebGUI/Asset/WikiPage.pm b/lib/WebGUI/Asset/WikiPage.pm index 71e050f8f..4e5874f2c 100644 --- a/lib/WebGUI/Asset/WikiPage.pm +++ b/lib/WebGUI/Asset/WikiPage.pm @@ -53,7 +53,9 @@ sub addRevision { sub canAdd { my $class = shift; my $session = shift; - $class->next::method($session, undef, '7'); + my $assetCanAdd = $class->next::method($session, undef, '7'); + my $parentCheck = $session->asset->isa('WebGUI::Asset::Wobject::WikiPage'); + return $assetCanAdd && $parentCheck; } #-------------------------------------------------------------------