per wobject privileges

This commit is contained in:
JT Smith 2003-06-22 16:15:49 +00:00
parent 4612a88f96
commit 3f4e5f3fbd
17 changed files with 2623 additions and 2444 deletions

View file

@ -24,7 +24,11 @@ our @EXPORT = qw(&www_deployPackage &www_selectPackageToDeploy);
#-------------------------------------------------------------------
sub _duplicateWobjects {
my ($sth, $wobject, $cmd, %hash, $extra, $w);
my ($sth, $wobject, $cmd, %hash, $extra, $w, %properties, $page);
tie %properties, 'Tie::CPHash';
#-- Added by Frank Dillon. Get page privilege information for the package
$page = WebGUI::SQL->quickHashRef("select ownerId,groupIdView,groupIdEdit from page where pageId=".quote($_[0]));
#-- End Changes
$sth = WebGUI::SQL->read("select * from wobject where pageId=$_[0] order by sequenceNumber");
while ($wobject = $sth->hashRef) {
$extra = WebGUI::SQL->quickHashRef("select * from ${$wobject}{namespace} where wobjectId=${$wobject}{wobjectId}");
@ -34,6 +38,13 @@ sub _duplicateWobjects {
$cmd = "WebGUI::Wobject::".${$wobject}{namespace};
$w = $cmd->new($wobject);
$w->duplicate($_[1]);
#-- Added by Frank Dillon. Set privileges for newly duplicated wobjects
%properties=();
$properties{ownerId} = ${$page}{ownerId};
$properties{groupIdView} = ${$page}{groupIdView};
$properties{groupIdEdit} = ${$page}{groupIdEdit};
$w->set(\%properties);
#-- End Changes
}
$sth->finish;
}