Allow other users to save photos into another user's album. Fixes bug #11228.

This commit is contained in:
Colin Kuskie 2009-11-13 17:16:56 -08:00
parent c4ab124380
commit 1f49737ae7
4 changed files with 16 additions and 11 deletions

View file

@ -15,6 +15,7 @@
- fixed #11216: LDAP Connections status incorrect
- fixed #11229: ProgressBar throws errors on some messages.
- fixed #11217: LDAP authentication fails if user DN changes
- fixed #11228: Gallery image upload to other users folder permission denied
7.8.4
- Fixed a compatibility problem between WRE and new Spectre code.

View file

@ -738,6 +738,19 @@ sub update {
}
#----------------------------------------------------------------------------
=head2 validParent ( )
Override validParent to only allow GalleryAlbums to hold GalleryFiles.
=cut
sub validParent {
my ($class, $session) = @_;
return $session->asset->isa('WebGUI::Asset::Wobject::GalleryAlbum');
}
#----------------------------------------------------------------------------
=head2 view ( )

View file

@ -306,10 +306,7 @@ sub canEdit {
my $form = $self->session->form;
# Handle adding a photo
if ( $form->get("func") eq "add" ) {
return $self->canAddFile;
}
elsif ( $form->get("func") eq "editSave" && $form->get("className") eq __PACKAGE__ ) {
if ( $form->get("func") eq "add" || $form->get("func") eq "editSave" ) {
return $self->canAddFile;
}
else {

View file

@ -32,6 +32,7 @@ WebGUI::Test->usersToDelete($user{'2'});
my $versionTag = WebGUI::VersionTag->getWorking($session);
$versionTag->set({name=>"Album Test"});
addToCleanup($versionTag);
my $gallery
= $node->addChild({
className => "WebGUI::Asset::Wobject::Gallery",
@ -104,10 +105,3 @@ $maker->prepare({
fail => [ 1, ],
});
$maker->run;
#----------------------------------------------------------------------------
# Cleanup
END {
$versionTag->rollback();
}