From 7aca0d15f8a71d3f4aae0ea769ba1a388f5edf85 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Wed, 13 Aug 2008 20:41:33 +0000 Subject: [PATCH] fixed: File Pile doesn't respect edit permissions of parent asset --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/FilePile.pm | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 76f84260a..c1a509c8d 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,4 +1,5 @@ 7.5.20 + - fixed: File Pile doesn't respect edit permissions of parent asset - fixed: shortcut overrides new value column doesn't show macros as unparsed - fixed: shortcut select by alternate criteria wizard doesn't show lists properly - fixed: The indent loop of the Navigation wobject has an incorrect number of diff --git a/lib/WebGUI/Asset/FilePile.pm b/lib/WebGUI/Asset/FilePile.pm index 6fb361668..f15e434e8 100644 --- a/lib/WebGUI/Asset/FilePile.pm +++ b/lib/WebGUI/Asset/FilePile.pm @@ -141,6 +141,13 @@ sub edit { #------------------------------------------------------------------- sub editSave { my $self = shift; + return $self->session->privilege->locked() unless $self->canEditIfLocked; + return $self->session->privilege->insufficient() unless $self->canEdit; + if ($self->session->config("maximumAssets")) { + my ($count) = $self->session->db->quickArray("select count(*) from asset"); + my $i18n = WebGUI::International->new($self->session, "Asset"); + return $self->session->style->userStyle($i18n->get("over max assets")) if ($self->session->config("maximumAssets") <= $count); + } ##This is a hack. File uploads should go through the WebGUI::Form::File API my $tempFileStorageId = WebGUI::Form::File->new($self->session,{name => 'file'})->getValue; @@ -249,8 +256,5 @@ sub www_edit { } } - - - 1;