fixes to the Gallery

This commit is contained in:
Doug Bell 2007-12-18 21:17:44 +00:00
parent 99274cd4ee
commit 53a1cbc7c2
8 changed files with 72 additions and 27 deletions

View file

@ -159,6 +159,19 @@ sub applyConstraints {
#----------------------------------------------------------------------------
=head2 canAdd ( )
Override canAdd to ignore its permissions check. Permissions are handled
by the parent Gallery and other permissions methods.
=cut
sub canAdd {
return 1;
}
#----------------------------------------------------------------------------
=head2 canComment ( [userId] )
Returns true if the user can comment on this asset. C<userId> is a WebGUI
@ -556,12 +569,21 @@ sub prepareView {
sub processPropertiesFromFormPost {
my $self = shift;
my $form = $self->session->form;
my $errors = $self->SUPER::processPropertiesFromFormPost || [];
# Return if errors
return $errors if @$errors;
# Passes all checks
### Passes all checks
# Fix if adding a new photo
if ( $form->get("assetId") eq "new" ) {
$self->update({
ownerUserId => $self->session->user->userId,
});
}
$self->requestAutoCommit;
}