fix - [ 1218475 ] cannot set "who to view" in style templates

This commit is contained in:
Roy Johnson 2005-06-13 02:59:36 +00:00
parent 7f61be9e85
commit 9b082133bb

View file

@ -1671,9 +1671,20 @@ sub template {
my $params = shift;
my $templateId = $params->{value} || $params->{defaultValue};
my $name = $params->{name} || "templateId";
my $userId = $session{user}{userId};
my $templateList = WebGUI::Asset::Template->getList($params->{namespace});
#Remove entries from template list that the user does not have permission to view.
for my $assetId ( keys %{$templateList} ) {
my $asset = WebGUI::Asset->new($assetId);
if (!$asset->canView($userId)) {
delete $templateList->{$assetId};
}
}
return selectList({
name=>$name,
options=>WebGUI::Asset::Template->getList($params->{namespace}),
options=>$templateList,
value=>[$templateId],
extras=>$params->{extras}
});