From fbd118d37ed53d0dc595ec93d9e979efd6ef4ee1 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 5 Feb 2009 20:02:52 +0000 Subject: [PATCH] fixed: Permissions aren't correctly applied to Article attachments --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/Article.pm | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 8e4c9ed8d..071291115 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -23,6 +23,7 @@ - fixed #9050: Safari Hover Help Hosed (and funny survey hover help in Firefox) - fixed #9675: gallary search list displays wrong date for pictures - fixed: Added survey.css as a snippet. Had been left out. + - fixed: Permissions aren't correctly applied to Article attachments 7.6.10 - fixed #9577: WebGUI::Form::Url::getValue returns blank rather than undef for blank fields diff --git a/lib/WebGUI/Asset/Wobject/Article.pm b/lib/WebGUI/Asset/Wobject/Article.pm index bec5d3331..95ff92f90 100644 --- a/lib/WebGUI/Asset/Wobject/Article.pm +++ b/lib/WebGUI/Asset/Wobject/Article.pm @@ -234,6 +234,23 @@ sub processPropertiesFromFormPost { $self->setSize($size); } +#------------------------------------------------------------------- +sub update { + my $self = shift; + my $previousStorageId = $self->get('storageId'); + $self->SUPER::update(@_); + ##update may have entered a new storageId. Reset the cached one just in case. + if ($self->get("storageId") ne $previousStorageId) { + delete $self->{_storageLocation}; + } + $self->getStorageLocation->setPrivileges( + $self->get("ownerUserId"), + $self->get("groupIdView"), + $self->get("groupIdEdit"), + ); +} + + #------------------------------------------------------------------- sub purge {