fixed: Wiki attachments uploaded by non-Content Managers deleted by maintenance workflow

fixed: Non-Content managers unable to paste assets even with edit privileges
This commit is contained in:
Graham Knop 2008-04-01 14:42:11 +00:00
parent 970294d618
commit 35bfeac0ef
4 changed files with 14 additions and 7 deletions

View file

@ -48,12 +48,12 @@ sub duplicateBranch {
my $self = shift;
my $childrenOnly = shift || 0;
my $newAsset = $self->duplicate({skipAutoCommitWorkflows=>1});
my $newAsset = $self->duplicate({skipAutoCommitWorkflows=>1,skipNotification=>1});
my $contentPositions = $self->get("contentPositions");
my $assetsToHide = $self->get("assetsToHide");
foreach my $child (@{$self->getLineage(["children"],{returnObjects=>1})}) {
my $newChild = $childrenOnly ? $child->duplicate({skipAutoCommitWorkflows=>1}) : $child->duplicateBranch;
my $newChild = $childrenOnly ? $child->duplicate({skipAutoCommitWorkflows=>1, skipNotification=>1}) : $child->duplicateBranch;
$newChild->setParent($newAsset);
my ($oldChildId, $newChildId) = ($child->getId, $newChild->getId);
$contentPositions =~ s/\Q${oldChildId}\E/${newChildId}/g if ($contentPositions);

View file

@ -445,10 +445,13 @@ Returns "". Pastes an asset. If canEdit is False, returns an insufficient privil
=cut
sub www_paste {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
$self->paste($self->session->form->process("assetId"));
return "";
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
my $pasteAssetId = $self->session->form->process('assetId');
my $pasteAsset = WebGUI::Asset->newPending($self->session, $pasteAssetId);
return $self->session->privilege->insufficient() unless $pasteAsset->canEdit;
$self->paste($pasteAssetId);
return "";
}
#-------------------------------------------------------------------
@ -463,6 +466,9 @@ sub www_pasteList {
my $self = shift;
return $self->session->privilege->insufficient() unless $self->canEdit;
foreach my $clipId ($self->session->form->param("assetId")) {
my $pasteAsset = WebGUI::Asset->newPending($self->session, $clipId);
next
unless $pasteAsset->canEdit;
$self->paste($clipId);
}
return $self->www_manageAssets();

View file

@ -689,7 +689,6 @@ An asset object reference representing the new parent to paste the asset to.
sub setParent {
my $self = shift;
my $newParent = shift;
return 0 unless $self->session->user->isInGroup('4');
return 0 unless (defined $newParent); # can't move it if a parent object doesn't exist
return 0 if ($newParent->getId eq $self->get("parentId")); # don't move it to where it already is
return 0 if ($newParent->getId eq $self->getId); # don't move it to itself