Skip to content

Commit

Permalink
Force inheritPermissionsFromParent to work in all import scenarios. A…
Browse files Browse the repository at this point in the history
…lso, fix handling of clearPackageFlag and setDefaultTemplate.
  • Loading branch information
perlDreamer committed Mar 15, 2010
1 parent 5463f96 commit b526340
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/changelog/7.x.x.txt
Expand Up @@ -6,6 +6,7 @@
- fixed #11464: blank page after setting posts per page in Collaboration System to 0 (zero)
- fixed #11472: View Calendar Month help missing
- fixed #11471: Errors in Calendar Event Edit template (Dale Trexel / U of MN Law School)
- fixed #11475: Inherit permissions on imported package fails if asset already exists.

7.8.14
- fixed #11442: PickLanguage template missing after 7.7 to 7.8 upgrade
Expand Down
16 changes: 9 additions & 7 deletions lib/WebGUI/AssetPackage.pm
Expand Up @@ -128,6 +128,14 @@ from the asset where it is deployed.
Forces the package to ignore the revisionDate inside it. This makes the imported package the
latest revision of an asset.
=head4 clearPackageFlag
Clears the isPackage flag on the incoming asset.
=head4 setDefaultTemplate
Set the isDefault flag on the incoming asset. Really only works on templates.
=cut

sub importAssetData {
Expand Down Expand Up @@ -181,16 +189,10 @@ sub importAssetData {
};
if (defined $asset) { # create a new revision of an existing asset
$error->info("Creating a new revision of asset $id");
$asset = $asset->addRevision($data->{properties}, $version, {skipAutoCommitWorkflows => 1});
$asset = $asset->addRevision(\%properties, $version, {skipAutoCommitWorkflows => 1});
}
else { # add an entirely new asset
$error->info("Adding $id that didn't previously exist.");
my %properties = %{ $data->{properties} };
if ($options->{inheritPermissions}) {
$properties{ownerUserId} = $self->get('ownerUserId');
$properties{groupIdView} = $self->get('groupIdView');
$properties{groupIdEdit} = $self->get('groupIdEdit');
}
$asset = $self->addChild(\%properties, $id, $version, {skipAutoCommitWorkflows => 1});
}
}
Expand Down

0 comments on commit b526340

Please sign in to comment.