From 019ebba6f267317537f061d8a0274b075db735a0 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 4 Feb 2010 14:02:08 -0800 Subject: [PATCH] Remove update override sub, and use the new Asset triggers instead. --- lib/WebGUI/Asset/Wobject/Article.pm | 42 ++++++++++++++--------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index b2db93488..dbe41ea63 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -72,6 +72,27 @@ sub _set_storageId { sub _storageid_deleteFileUrl { return shift->session->url->page("func=deleteFile;filename="); } +sub _set_ownerUserId { + my ($self, $new, $old) = @_; + if ($new ne $old) { + $self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit); + } +} + +sub _set_groupIdView { + my ($self, $new, $old) = @_; + if ($new ne $old) { + $self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit); + } +} + +sub _set_groupIdEdit { + my ($self, $new, $old) = @_; + if ($new ne $old) { + $self->getStorageLocation->setPrivileges($self->ownerUserId, $self->groupIdView, $self->groupIdEdit); + } +} + use WebGUI::Storage; use WebGUI::HTML; @@ -257,27 +278,6 @@ sub processPropertiesFromFormPost { $self->setSize($size); } -#------------------------------------------------------------------- - -=head2 update ( ) - -Extend the super class to handle the storage location. Sets -the correct privileges and deletes the internally cached -Storage object. - -=cut - -sub update { - my $self = shift; - $self->SUPER::update(@_); - $self->getStorageLocation->setPrivileges( - $self->get("ownerUserId"), - $self->get("groupIdView"), - $self->get("groupIdEdit"), - ); -} - - #------------------------------------------------------------------- =head2 purge ( )